I wonder how I can to determine that event had stopped.
I’ve tried to use Event::getState, but this function can be called for stolen sound, and I can get wrong info (please correct me if I’m wrong).
I’ve tried to use EVENT_CALLBACKTYPE_EVENTFINISHED, but it never comes… May be I’m doing smth wrong…
When I can reveive this callback?
It’s interesting, that for oneshot events Sound::getLoopCount tells -1. Is that right?..
Please, please help! )
- torin_duboshit asked 12 years ago
you can use the state to test if the EVENT_STATE_READY flag is set. i’m not sure what you mean by ‘stolen sound’ though. i have also tried to use the event callback, but i’m not getting EVENT_CALLBACKTYPE_EVENTFINISHED either, even after i call stop on the event.
- dave7L answered 12 years ago
You musn’t be testing the right bits, there is EVENT_STATE_PLAYING which is set when start is called and before cleared when stop called, or the event stops because it is a ‘one shot’ event (event properties) or a parameter has been set to stop an event when it hits its maximum value.
Next there is the EVENT_STATE_CHANNELSACTIVE bit which is set if there are any active voices playing inside the event (the event can still be ‘playing’ even though there are no sounds playing – it depends where the parameter is).
Where are you getting ‘Sound::getLoopCount’ from? There are not even any sound handles exposed to the user from the event system?
End callbacks arent called when you call stop, because there really isnt much point. You’re specifically calling stop, so all you have to do is call the function that you wanted the logic executed in when you call stop.
Please login first to submit.