Skip to content

Select the playback speed from a list of presets - #570

Open
benjamimo1 wants to merge 1 commit into
powertab:masterfrom
benjamimo1:playback-speed-presets
Open

Select the playback speed from a list of presets#570
benjamimo1 wants to merge 1 commit into
powertab:masterfrom
benjamimo1:playback-speed-presets

Conversation

@benjamimo1

Copy link
Copy Markdown

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:

  • PercentageValidator now 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.
  • Unlike the zoom box, which applies on every 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. typing 125 passes through 1 and 12, 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)

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.
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.

1 participant