diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2021-12-27 21:01:58 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2021-12-27 21:01:58 +0100 |
commit | c2017d9599e413e13967b0a6268d92e19451249a (patch) | |
tree | eba73a86704d9a83f90f18c683720a811e06d3a7 /solo_tool_qt.py | |
parent | f52e40f899567d5d67a4cb2dcd75872ee038aaf8 (diff) |
Added playback speed slider
Diffstat (limited to 'solo_tool_qt.py')
-rw-r--r-- | solo_tool_qt.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/solo_tool_qt.py b/solo_tool_qt.py index 8678800..bca71d0 100644 --- a/solo_tool_qt.py +++ b/solo_tool_qt.py @@ -6,6 +6,7 @@ from MainWindow import Ui_MainWindow from solo_tool import SoloTool POSITION_FACTOR = 100000 +RATE_FACTOR = 10 UI_REFRESH_PERIOD_MS = 500 class PlaylistModel(QAbstractListModel): @@ -63,6 +64,11 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.bSlider.setMaximum(POSITION_FACTOR) self.bSlider.sliderReleased.connect(self.abSliderReleased) + self.rateSlider.setRange(int(0.5 * RATE_FACTOR), int(1.5 * RATE_FACTOR)) + self.rateSlider.setSingleStep(int(0.1 * RATE_FACTOR)) + self.rateSlider.setValue(int(1.0 * RATE_FACTOR)) + self.rateSlider.sliderReleased.connect(self.rateSliderReleased) + self.playButton.pressed.connect(self.soloTool.play) self.pauseButton.pressed.connect(self.soloTool.pause) self.saveAbButton.pressed.connect(self.saveAbLimits) @@ -126,6 +132,10 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.soloTool.setAbLimits(a, b) self.clearAbListSelection() + def rateSliderReleased(self): + rate = self.rateSlider.value() / float(RATE_FACTOR) + self.soloTool.setPlaybackRate(rate) + def playlistSelectionChanged(self, i): index = i.indexes()[0].row() self.soloTool.setSong(index) |