Acting on KeyFrame create/destroy and modify #1886
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces callbacks to Layer and KeyFrame, in order to be able to notify when a keyframe has been created, destroyed and modified.
For Keyframe creations: One benefit here is for example to be able to setup a SoundClip and not having to worry whether the SoundPlayer gets created or not because it's handled universally in Editor. In addition it also opens up for a more general handling of adding dependencies to Layer or KeyFrame without creating tight coupling.
For keyframe modifications: All modification() calls on KeyFrame will automatically now trigger a frameModified event. In practice this means that we might see more frameModified and potentially double updates to scribblearea because this has until now been handled with manual frameModified calls. As such I've removed
frameModifiedemits where I could see a KeyFrame::modification() call was also made.For KeyFrame destructions: Currently unused but could be used for cleanup tasks.
It's important to note that to get callbacks working properly, I had to make some changes to when we create a keyframe on Layer and move the entire default layer setup from Object to LayerManager.