getGroupByIndex returns an invalid handle error if no .fevs are loaded.
This is inconsistant from the normal where if no events are found than FMOD_ERR_INVALID_PARAM is returned while iterating through the possible groups.
I was hoping to disable all sound playback by just not loading any files and having my code not find any sounds. however since this error is treated seperatly (as a real error since FMOD_ERR_INVALID_PARAM is used to indicate that there are no more events in a group)..
Because our engine does not use C style strings or anything that can be converted to them (but i can convert C strings into our strings) I have to iterate through all groups and build a conversion table based off of their name.
Is there no way to just ask how many groups/events are in a group?
- stephenmccaul asked 12 years ago
Having this function (how many events) would reduce the complexity of some code by quite a lot actually. In a couple of places I have to loop through a group to find a subgroup/event.
My use of this is isolated but very ugly. The cause for me doing it is out of my control and has to do with policy of string use in our engine.
I am doing the check for both errors now. It is just very hacky on my side since i now have to check for four different classes of results. Having a getCount function would reduce this sort of usage to having a simple pass/fail error check. Now I am using the result code to tell when I have reached the end of a group and there are two possible results that end my iteration. This means two results imply loop termination, one for success and then the other case which indicates a “real” error.
Would it return a bad handle if i was calling eventsystem->getGroupCount() or equivilent?
It seems like detecting the lack of groups would imply a count of 0.
This is a bit nitpicky but iterating through groups is something that FMOD users occationally do and itis messy to do that with the existing interface. And I can’t imagine it is hard to add the code to make this nice and easy since all that is needed is a way to query the counts of items.
Please login first to submit.