Hi everybody!

Can you help me? 😕

I’m doing a CSound class which has a function to play files. This function calls open and play, but doesn’t close the file played. Using
ret=FSOUND_Stream_SetEndCallback(handle, endcallback, 0);
and a C function I close the file played when it is over. My problem is that I would like to add a flag to my PlayFile method, something like "only_one_instance_at_the_same_time" to avoid or allow what you are thinking :)
So my idea is that, if that file is true, add the current file to a list in my class, and remove when is over, using this I can avoid playing a file if that flag is true, just look the file in my list. The problem is that after playing the file , I have to remove it from my list, but as my endcallback function is C (not C++) I cannot access to member atributes in my class.

So my question is, how can I access to class attributes from a C function OR how can I create a end callback function using C++ and use it with FMOD (in order to access to my attributes)?

Thank you very much for your help.

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.