0
0

Hey,
I saw that you can use the getInfo function to get all the current playing events using the FMOD_EVENT struct. This seems to be a great way to figure out what is hogging all the streams that we are currently trying to use, but I have run into a problem. There is no documentation about FMOD_EVENT so I can get a pointer to it but can’t use it 😛

Dose anybody know where I can find more information about this struct or give some code example?

Cheers
Daniel

  • You must to post comments
0
0

FMOD_EVENT is the C API equivalent of FMOD::Event. They have to do it that way in order for the API to work with C. You can cast your FMOD_EVENT* to an FMOD::Event* directly.

  • You must to post comments
0
0

Thanks for the Adiss.
Next question, what is wrong with this:

[code:1wwqo8uo]
FMOD_EVENT_SYSTEMINFO info;
memset(&info, 0, sizeof(FMOD_EVENT_SYSTEMINFO));
FMOD_EVENT * buffer[20];
info.playingevents = buffer;
m_pEventsystem->getInfo( &info );

for( int i = 0; i < info.numplayingevents; i++ )
{
int index = -99;

FMOD_Event_GetInfo(info.playingevents[i], &amp;index, 0, 0);
printf(&quot; Event ID: %d&quot;, index );

}
[/code:1wwqo8uo]

All I get back is the id being -99, like it doesn’t change anything when I call GetInfo. Any ideas?

  • You must to post comments
0
0

You need to tell FMOD how many playing events are in the array.

Try the following: [code:3v195o8x]
FMOD_EVENT_SYSTEMINFO info;
memset(&info, 0, sizeof(FMOD_EVENT_SYSTEMINFO));
FMOD_EVENT * buffer[20];
info.playingevents = buffer;
info.numplayingevents = 20; // <– New line
m_pEventsystem->getInfo( &info );

for( int i = 0; i < info.numplayingevents; i++ )
{
int index = -99;

FMOD_Event_GetInfo(info.playingevents[i], &index, 0, 0);
printf(" Event ID: %d", index );
}
[/code:3v195o8x]

Hope that helps.

  • You must to post comments
0
0

Hey Adiss,
Thanks for that, it worked a treat. I assumed that the info.numplayingevents returned the number of events playing. Should read the docs more closely :roll:
Thanks again

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.