aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--known-issues4
-rw-r--r--solo_tool_qt.py24
2 files changed, 19 insertions, 9 deletions
diff --git a/known-issues b/known-issues
index ee52956..305a1a7 100644
--- a/known-issues
+++ b/known-issues
@@ -1,5 +1,5 @@
-* Moving AB sliders does not set AB limit. Instead need to save AB limit and then select it to apply
+* (done) Moving AB sliders does not set AB limit. Instead need to save AB limit and then select it to apply
* (done) Loading session is additive, should clear the state first
* AB limits are displayed as p.u., should be timestamps
* (done) Songs are displayed as full path, should be file name or ideally title from metadata
-* When switching between songs, AB limit selection is not reset, this means that if the song has only one limit, it is not possible ot load it anymore
+* (done) When switching between songs, AB limit selection is not reset, this means that if the song has only one limit, it is not possible to load it anymore
diff --git a/solo_tool_qt.py b/solo_tool_qt.py
index 7c17a33..8678800 100644
--- a/solo_tool_qt.py
+++ b/solo_tool_qt.py
@@ -59,7 +59,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.songSlider.sliderReleased.connect(self.songSliderReleased)
self.aSlider.setMaximum(POSITION_FACTOR)
+ self.aSlider.sliderReleased.connect(self.abSliderReleased)
self.bSlider.setMaximum(POSITION_FACTOR)
+ self.bSlider.sliderReleased.connect(self.abSliderReleased)
self.playButton.pressed.connect(self.soloTool.play)
self.pauseButton.pressed.connect(self.soloTool.pause)
@@ -114,21 +116,29 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.soloTool.setPlaybackPosition(position)
self.timer.start()
+ def clearAbListSelection(self):
+ i = self.abListView.selectionModel().currentIndex()
+ self.abListView.selectionModel().select(i, QItemSelectionModel.Deselect)
+
+ def abSliderReleased(self):
+ a = self.aSlider.value() / float(POSITION_FACTOR)
+ b = self.bSlider.value() / float(POSITION_FACTOR)
+ self.soloTool.setAbLimits(a, b)
+ self.clearAbListSelection()
+
def playlistSelectionChanged(self, i):
index = i.indexes()[0].row()
self.soloTool.setSong(index)
self.abListModel.layoutChanged.emit()
- self.abListSelectionChanged(None)
+ self.clearAbListSelection()
def abListSelectionChanged(self, i):
- if i is not None:
+ if i is not None and not i.isEmpty():
index = i.indexes()[0].row()
ab = self.soloTool.getAbLimits()[index]
- self.soloTool.setAbLimit(index)
- else:
- ab = (0, 0)
- self.aSlider.setValue(int(ab[0] * POSITION_FACTOR))
- self.bSlider.setValue(int(ab[1] * POSITION_FACTOR))
+ self.soloTool.loadAbLimits(index)
+ self.aSlider.setValue(int(ab[0] * POSITION_FACTOR))
+ self.bSlider.setValue(int(ab[1] * POSITION_FACTOR))
if __name__ == '__main__':
app = QApplication([])