Select the playback speed from a list of presets - #570
Open
benjamimo1 wants to merge 1 commit into
Open
Conversation
Replace the playback speed spin box with an editable combo box offering 25%, 50%, 75% and 100% presets, mirroring the existing zoom selector. Any other speed can still be entered by typing directly into the box, so the minimum was lowered from 50% to 25% to accommodate the new preset. PercentageValidator now takes the valid range as constructor arguments so that it can be shared between the zoom and speed selectors. Unlike the zoom box, the speed is applied when the value is committed rather than on every keystroke, so that playback doesn't audibly lurch through the intermediate values while a custom speed is being typed.
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.
Description of Change(s)
Replaces the playback speed spin box with an editable combo box offering 25%, 50%, 75% and 100% presets, imitating the zoom selector as suggested in the issue. Any other speed can still be typed directly into the box. The minimum was lowered from 50% to 25% to accommodate the new preset; the 125% maximum is unchanged.
Two notes on the implementation:
PercentageValidatornow takes the valid range as constructor arguments so that it can be shared between the zoom and speed selectors, including the existing red-text styling for out-of-range values.currentTextChanged, the speed is applied once the value is committed (activated/editingFinished). Applying it on each keystroke would make playback audibly lurch through the intermediate values while a custom speed is being typed - e.g. typing125passes through1and12, which would both be clamped to 25%. Relatedly,getPlaybackSpeed()now returns a cached member rather than parsing the combo box text, so that a partially-typed value can't be read as the current speed.Fixes Issue(s)