Fix visual glitch when using next-terminates-loop#605
Open
melyso wants to merge 1 commit intojeertmans:mainfrom
Open
Fix visual glitch when using next-terminates-loop#605melyso wants to merge 1 commit intojeertmans:mainfrom
melyso wants to merge 1 commit intojeertmans:mainfrom
Conversation
Author
|
I now realize I was mistaken in my note - the jump in complexity in the Would it be preferable to leave it as-is, should I deviate by defining the hook itself outside of init and only connect it within the conditional, or do you have another suggestion? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes Issue
Closes #500
Description
The previous workaround to QMediaPlayer's limitations in changing looping behavior on-the-fly, involved stopping-and-resuming video clips mid-loop. This is replaced with setting an internal flag
__termination_requestedwhich indicates that termination has been requested. Furthermore, through implementing a slot for the positionChanged signal, the beginning of new loops are detected as non-monotonicity in the position (outside of the load_next_slide() function), which, after the__termination_requested-flag is set, triggersload_next_slide()function. This seems to remove any non-smooth behavior at the key press, and seems to advance the presentation to the next slide at the first possible finished loop iteration as expected.Check List
Check all the applicable boxes:
Note to reviewers
It seems I got 3 warnings when running the tests locally, but they seemed to not be related to my changes. Due to only implementing the hook in question if the
next-terminates-loopflag is set, my changes increased the complexity of the__init__function from 12 to 13, although at 12 it was already above the threshold level (10) before my changes.I am unsure if the adding of a slot to the positionChanged signal adds any significant overhead which could impact the performance/result in any increased lag in animations in general. I didn't see any clear signs of this when testing.
As this is simply a bug fix, nothing was changed in the docs.