这是indexloc提供的服务,不要输入任何密码
Skip to content

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.

3 participants