i want to use event categories to manage different types of playback like sound fx, music, voice, etc. i’m trying to find a way of determining if a particular category has any events that are playing at a given time. since there seems to be no way of getting all events from a category, i’m looking at the channel group assigned to that category. the only way i see to do this is to look at every channel of every sub-group of every group, etc., until i hit one that is playing.
it would be really nice if there was a EventCategory::getNumEvents and a EventCategory::getEventByIndex that would work over all fev’s that are currently loaded. 8)
- dave7L asked 12 years ago
I can add EventCategory::getNumEvents() and EventCategory::getEventByIndex() pretty easily and then you could use Event::getInfo() and check the "instancesactive" member. Would that work for you?
Each EventCategory has exactly one ChannelGroup.
well, i am able to do what i need to do by digging through the main channel group, as tedious as it may be. those methods would probably simplify my implementation quite a bit though – as long as they are guaranteed to work when multiple fev’s are loaded.
the way i have been handling this (as advised by someone who has already done it) is to make a project that contains all the categories that will be used throughout the game. that project is loaded first and all category references are created. all other projects will only contain categories that are listed in the master project. this will (hopefully) ensure that whenever i examine my event category to determine if it has any events that are playing, i wll be looking at all events in all projects that have been loaded in that category.
i’ve also been trying to use event callbacks to make this whole process even simpler, but for some reason i only get callbacks for EVENT_CALLBACKTYPE_SOUNDDEF_INFO and EVENT_CALLBACKTYPE_SOUNDDEF_START. i am not getting any type of callback when when the event/sounddef has finished/stopped, even after i call stop on the event.
Please login first to submit.