Ive made a playlist class, and it has a private member channel, i use this to keep track of the playlist ( Don’t know if this is the right way to do it ). Im playing a song by referencing the channel as follows:
[code:2qeqgxxs]SOUND.playSound( song, m_playlistChannel );[/code:2qeqgxxs]
playSound does the following:
result = m_system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);
It plays fine, but when it comes to certain event likes pausing or checking if the songs ending nothing happens. Im doing the following checks:
m_playlistChannel->getPaused( &queryPause );
if( queryPause == false )
m_playlistChannel->setPaused( true );[/code:2qeqgxxs]
Its similiar for stopping and resuming.
What am i doing wrong?
- InfiniteDaremo asked 10 years ago
When you call your playSound function, you pass in that channel pointer and modify it, but the pointer referenced in that function is just a copy. The original pointer (m_playlistChannel) doesn’t get modified and is probably still null. You probably want your function to look more like this:
void playSound( FMOD::Sound *sound, FMOD::Channel **channel );
Hope that helps.
- methinkso answered 10 years ago
It is, heres the declaration:
[code:1a0c9nom]void playSound( FMOD::Sound *sound, FMOD::Channel *channel );[/code:1a0c9nom]
The playlist channel is also declared as so:
Is my code correct for checking if a channel has certain properties?
Also this playlistChannel is in a sepatate class to my FMOD::system. Do i need to let the system know about this channel?
Thanks for the reply.
Please login first to submit.