Listing events in C API

(Luis Enrique Vargas) #1

Hi, I’m just trying to list all the events in a bank but I’m receiving error 74 (I think it means FMOD_ERR_EVENT_NOTFOUND), my code is this:

            ret=FMOD_Studio_Bank_GetEventCount(bank,  &count);                
                memset(events, 0, sizeof(events));
                ret=FMOD_Studio_Bank_GetEventList(bank, events, count, &count);
                if (ret != FMOD_OK) {
                    cout << ret << endl;
                for(int i=0;i<count;i++){
                    char eventPath[256];
                    int len=0;
                    ret=FMOD_Studio_EventDescription_GetPath(events[i], eventPath, sizeof(eventPath)-1, &len);
                        cout << i << " " << ret << endl;
                    cout << eventPath << endl;
                delete [] events;

My program does enter in this if:

                        cout << i << " " << ret << endl;

and that means that getEventCount and also GetEventList, both received FMOD_OK like return value.
Any idea what’s happening?

(Nicholas Wilcox) #2

In order to lookup via path or retrieve the path of an event, you need to load the optional strings bank. If you haven’t renamed the master bank the strings bank will be called Master and is loaded using the same functions as any other bank.