I have loaded a bank and want to iterate through all the events it contains. From the documentation, it looks like I should use FMOD_Studio_Bank_GetEventCount() to get the count of the events and use this count to create a buffer to pass to FMOD_Studio_Bank_GetEventList() to retrieve an array of FMOD_STUDIO_EVENTDESCRIPTIONs.
However, FMOD_STUDIO_EVENTDESCRIPTION is defined in fmod_studio_common.h as
This is more of a C/C++ type question to do with allocating the memory needed for the array of event descriptions.
int i;
sfxBank->getEventCount(&i);
const int list = i;
FMOD::Studio::EventDescription** eventList = new FMOD::Studio::EventDescription*[list];
sfxBank->getEventList(eventList, i, &i);
You need to make the event description array and array of pointers for it to work.
Hi Richard, Thanks for your answer, however I am using the C API, not the C++ API. In the C++ headers the EventDescription class is fully declared so
new FMOD::Studio::EventDescription*[list];
will allocate the required memory for the array. In the C headers, the FMOD_STUDIO_EVENTDESCRIPTION type is not fully declared, therefore there is no way for the compiler to know the size of the type, and therefore no way to allocate the memory.