Skip to content
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

Fix for #547. Can play and delete sound from any frame in its length. #600

Merged
merged 1 commit into from Feb 12, 2017

Conversation

martinvanzijl
Copy link
Contributor

Fix for #547. You can now play a sound from any frame in its duration, not just its starting frame.

You can also delete and move the sound from any frame.

Code Changes:

  • Added "mCheckForSoundsHalfway" flag to PlaybackManager. Set to true when starting playback - to check whether to play any sound from part-way through.
  • Added "getKeyFrameWhichCovers(pos)" to Layer. This returns the keyframe which covers pos. E.g. a sound clip starting at frame 1 and ending at frame 6 covers frames 1, 2, 3, 4, 5, 6.
  • Updated Layer methods "isFrameSelected(pos)" and "setFrameSelected(pos)" to use "getKeyFrameWhichCovers". I could possibly move this logic change to the LayerSound class and keep Layer as is.
  • Added "playFromPosition()" to SoundClip to play sound from part-way through.

@Jose-Moreno
Copy link
Member

@martinvanzijl This is fantastic Martin! Hopefully @chchwy Can check it out to see if everything works properly and merge it right away 😄

@chchwy
Copy link
Member

chchwy commented Feb 12, 2017

Well done, @martinvanzijl

@chchwy chchwy merged commit ef9afb8 into pencil2d:master Feb 12, 2017
@martinvanzijl martinvanzijl deleted the Bug_547_Sound_Timing branch March 6, 2017 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants