diff options
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) |