0
0

After some searching in the docs and on the forum I couldn’t find an answer to the following question:

If I call FMOD_Channel(pChannel) will pChannel by set to 0/NULL? Or do I have to do this manually?

  • You must to post comments
0
0

FMOD_Channel()? There is no such function.

  • You must to post comments
0
0

Sorry, I meant FMOD_Channel_Stop(pChannel)

  • You must to post comments
0
0

that function does not set anything passed to it, because you did not pass the address of the channel, nor is it passed by reference. There is no way in C/C++ that it could change this variable.

  • You must to post comments
0
0

I am sorry, I can’t understand you completely

In my SoundObject class I have a variable:

[code:vw9m2yhi]
FMOD_CHANNEL* pChannel;
[/code:vw9m2yhi]

This variable is used in the constructor of the SoundObject, with an FMOD_SOUND* sound as parameter with the following code:

[code:vw9m2yhi]
FMOD_SYSTEM* system = SoundSystem::getSingleton()._getFMODSystem()
FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, true, &pChannel);
[/code:vw9m2yhi]

Since FMOD_Channel_Stop(FMOD_CHANNEL*) will free the channel for use of another Sound, I would like to know if the pChannel was set NULL/0 in this operation.
This is because when I want to restart the SoundObject after I have stopped it, I think I have to call FMOD_System_PlaySound() with FMOD_CHANNEL_FREE again? I would like to do this based on the value of pChannel (when 0/NULL it needs to use FMOD_CHANNEL_FREE again, otherwise I can call other operations in my SoundObject class).

If I did not pass the adress of the Channel, than what did I pass in FMOD_Channel_Stop(FMOD_CHANNEL*)?

Maybe I am lost a bit…[/code]

  • You must to post comments
0
0

[quote="jorrit5477":1dzh0779]This variable is used in the constructor of the SoundObject, with an FMOD_SOUND* sound as parameter with the following code:

[code:1dzh0779]
FMOD_SYSTEM* system = SoundSystem::getSingleton()._getFMODSystem()
FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, true, &pChannel);
[/code:1dzh0779]

Since FMOD_Channel_Stop(FMOD_CHANNEL*) will free the channel for use of another Sound, I would like to know if the pChannel was set NULL/0 in this operation.[/quote:1dzh0779]http://www.cplusplus.com/doc/tutorial/pointers.html
Look more carefully at the code there. You see how pChannel has an & at the beginning in the PlaySound call and not in the Stop call?

  • You must to post comments
0
0

Mmm, always those pointers and references… difficult to grasp the concept of those… 😕 But tnx, I think I understand what is happening :roll:

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.