-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PlayUntilFinishedAction #310
base: master
Are you sure you want to change the base?
Conversation
Hi Andrea, I'm not so sure about if it should be an IntervalAction: IntervalActions have a deterministic duration, known at instantiation time, and are very well behaved with respect to time: in particular if two actions that are sum of interval actions have same total duration, if they start at the same tick they will end in a future same tick. This is important in some cases to have specific alignments. If the play action does not respect the duration, a composite may not be precise. And the play action can not respect the get_lenght duration, because
So maybe it should be an Action, not an IntervalAction A note for future: From the cocos's API point of view it would be nice to have
|
Claudio, I had decided not to bother with adding AVbin support for the same reason I'm using the SDL backend in my personal project: last stable release for AVbin was on 23 Aug 2012, which led me to believe that it's been abandoned. I originally intended to subclass I wasn't aware that an ffmpeg backend even existed, since documentation never references it. I might switch to that backend on my personal project once it reaches a stable release. For now, I'll look into adding support for it in this PR, along with AVbin. |
upcoming pyglet 1.4 will move to ffmpeg4 support, abandoning ffmpeg3.x and AVbin. |
This PR adds
PlayUntilFinishedAction
to thecocos.audio.actions
package. As the name states, it's anIntervalAction
that doesn't report itself to be done until the sound actually finishes. This is extremely useful for doing actions upon the end of a sound effect.A real-world example of its utility is in my own project, cinche, where it's already being used here to transition to a new scene the moment the sound effect stops playing.
Additionally, this also makes
Effect
s fromcocos.audio.effect
exposes a few more properties of the wrappedcocos.audio.SDL.mixer.Sound
in order for this to work properly.