From e2d0e84992c539d0aa249483cad3ceca96bb03d9 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Sun, 2 Jan 2022 16:06:31 +0100 Subject: Improved Qt GUI layout, added set A and set B buttons --- solo_tool_qt.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'solo_tool_qt.py') diff --git a/solo_tool_qt.py b/solo_tool_qt.py index 7bb3821..44f2ee4 100644 --- a/solo_tool_qt.py +++ b/solo_tool_qt.py @@ -73,7 +73,9 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.playButton.pressed.connect(self.soloTool.play) self.pauseButton.pressed.connect(self.soloTool.pause) - self.saveAbButton.pressed.connect(self.saveAbLimits) + self.storeAbButton.pressed.connect(self.storeAbLimits) + self.setAButton.pressed.connect(self.setA) + self.setBButton.pressed.connect(self.setB) self.saveSessionButton.pressed.connect(self.saveSession) self.loadSessionButton.pressed.connect(self.loadSession) self.addSongButton.pressed.connect(self.addSong) @@ -94,12 +96,22 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.soloTool.addSong(path) self.playlistModel.layoutChanged.emit() - def saveAbLimits(self): + def storeAbLimits(self): a = self.aSlider.value() / float(POSITION_FACTOR) b = self.bSlider.value() / float(POSITION_FACTOR) self.soloTool.storeAbLimits(a, b) self.abListModel.layoutChanged.emit() + def setA(self): + position = self.songSlider.value() + self.aSlider.setValue(position) + self.abSliderReleased() + + def setB(self): + position = self.songSlider.value() + self.bSlider.setValue(position) + self.abSliderReleased() + def toggleAbRepeat(self): enable = self.abRepeatCheckBox.isChecked() self.soloTool.setAbLimitEnable(enable) -- cgit v1.2.3