Skip to content

Commit

Permalink
Rename "Tempo override" slider to "Playback speed"
Browse files Browse the repository at this point in the history
  • Loading branch information
cbjeukendrup committed Nov 30, 2024
1 parent a1cc309 commit f8d0335
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 57 deletions.
4 changes: 2 additions & 2 deletions src/playback/playback.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<file>qml/MuseScore/Playback/qmldir</file>
<file>qml/MuseScore/Playback/PlaybackToolBar.qml</file>
<file>qml/MuseScore/Playback/internal/MeasureAndBeatFields.qml</file>
<file>qml/MuseScore/Playback/internal/TempoSlider.qml</file>
<file>qml/MuseScore/Playback/internal/TempoOverridePopup.qml</file>
<file>qml/MuseScore/Playback/internal/PlaybackSpeedSlider.qml</file>
<file>qml/MuseScore/Playback/internal/PlaybackSpeedPopup.qml</file>
<file>qml/MuseScore/Playback/MixerPanel.qml</file>
<file>qml/MuseScore/Playback/internal/MixerPanelSection.qml</file>
<file>qml/MuseScore/Playback/internal/MixerBalanceSection.qml</file>
Expand Down
19 changes: 8 additions & 11 deletions src/playback/qml/MuseScore/Playback/PlaybackToolBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ Item {
property alias navigationPanelOrder: navPanel.order

PlaybackToolBarModel {
id: playbackModel
id: thePlaybackModel
isToolbarFloating: root.floating
}

Component.onCompleted: {
playbackModel.load()
thePlaybackModel.load()
}

Column {
Expand All @@ -63,12 +63,12 @@ Item {

width: childrenRect.width

enabled: playbackModel.isPlayAllowed
enabled: thePlaybackModel.isPlayAllowed

PlaybackToolBarActions {
id: playbackActions

playbackModel: playbackModel
playbackModel: thePlaybackModel
floating: root.floating

navPanel: root.navigationPanel
Expand All @@ -77,21 +77,18 @@ Item {
StyledSlider {
width: playbackActions.width - 12
visible: root.floating
value: playbackModel.playPosition
value: thePlaybackModel.playPosition

onMoved: {
playbackModel.playPosition = value
thePlaybackModel.playPosition = value
}
}

TempoSlider {
PlaybackSpeedSlider {
width: playbackActions.width - 12
visible: root.floating
value: playbackModel.tempoMultiplier

onMoved: function(newValue) {
playbackModel.tempoMultiplier = newValue
}
playbackModel: thePlaybackModel
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ StyledPopupView {

StyledTextLabel {
Layout.fillWidth: true
text: qsTrc("playback", "Override tempo")
text: qsTrc("playback", "Speed")
font: ui.theme.bodyBoldFont
horizontalAlignment: Text.AlignLeft
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,73 +19,59 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick
import QtQuick.Layouts

import Muse.UiComponents 1.0
import Muse.Ui 1.0
import Muse.UiComponents
import Muse.Ui

import MuseScore.Playback

RowLayout {
id: root

property real value: 0
property real from: 0.1
property real to: 3
property real stepSize: 0.05

signal moved(real newValue)
property PlaybackToolBarModel playbackModel: null

height: 30
spacing: 0
spacing: 12

StyledTextLabel {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignVCenter

text: qsTrc("playback", "Tempo")
text: qsTrc("playback", "Speed")
font: ui.theme.largeBodyFont
horizontalAlignment: Text.AlignLeft
}

Item {
Layout.fillWidth: true
Layout.fillHeight: true
}

NumberInputField {
value: Math.round(root.value * 100)
minValue: root.from * 100
maxValue: root.to * 100
IncrementalPropertyControl {
Layout.preferredWidth: 76
currentValue: (root.playbackModel.tempoMultiplier * 100).toFixed(decimals)

live: false

addLeadingZeros: false
font: ui.theme.largeBodyFont
maxValue: 300
minValue: 10
step: 5
measureUnitsSymbol: "%"
decimals: 0

onValueEdited: function(newValue) {
root.moved(newValue / 100)
root.playbackModel.tempoMultiplier = newValue / 100
}
}

StyledTextLabel {
text: "%"
font: ui.theme.largeBodyFont
}

StyledSlider {
id: slider

Layout.preferredWidth: root.width / 2
Layout.leftMargin: 12

value: root.value
from: root.from
to: root.to
stepSize: root.stepSize
value: root.playbackModel.tempoMultiplier
from: 0.1
to: 3.0
stepSize: 0.05

fillBackground: false

onMoved: {
root.moved(slider.value)
root.playbackModel.tempoMultiplier = value
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Item {
width: 48
height: parent.height

accentButton: tempoOverridePopup.isOpened
accentButton: playbackSpeedPopup.isOpened
transparent: !accentButton

contentItem: TempoView {
Expand All @@ -183,11 +183,11 @@ Item {
}

onClicked: {
tempoOverridePopup.toggleOpened()
playbackSpeedPopup.toggleOpened()
}

TempoOverridePopup {
id: tempoOverridePopup
PlaybackSpeedPopup {
id: playbackSpeedPopup

playbackModel: root.playbackModel
}
Expand Down

0 comments on commit f8d0335

Please sign in to comment.