0
0

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:

[code:2qeqgxxs]FMOD_RESULT result;
result = m_system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);
ERRCHECK(result);[/code:2qeqgxxs]

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:

For pause:

[code:2qeqgxxs]bool queryPause;
m_playlistChannel->getPaused( &queryPause );
if( queryPause == false )
m_playlistChannel->setPaused( true );[/code:2qeqgxxs]

Its similiar for stopping and resuming.

What am i doing wrong?

  • You must to post comments
0
0

I suspect the channel arguments for (your) SOUND::playSound is not a channel*

  • You must to post comments
0
0

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:
[code:1a0c9nom]FMOD::Channel *m_playlistChannel;[/code:1a0c9nom]
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.

  • You must to post comments
0
0

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:

[code:rgafr5zl]
void playSound( FMOD::Sound *sound, FMOD::Channel **channel );
[/code:rgafr5zl]

Hope that helps.

  • You must to post comments
0
0

Yeah, that’s it… I was off by one pointer LOL.

  • You must to post comments
0
0

Gotta love pointers to pointers. Thanks for the help soo much.

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.