aboutsummaryrefslogtreecommitdiffstats
path: root/solo_tool.py
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2022-01-01 10:18:37 +0100
committerEddy Pedroni <eddy@0xf7.com>2022-01-01 10:18:37 +0100
commit71f6a49110b6696ca6ac7956baa4edaa1aaa9527 (patch)
treee16178d2db8c6a8b7459801aab34d46255d4e8f6 /solo_tool.py
parent9090422b2ba5eab9e4131f9b9281ed83128d977c (diff)
Added partial Launchpad support, refactored existing files
Diffstat (limited to 'solo_tool.py')
-rw-r--r--solo_tool.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/solo_tool.py b/solo_tool.py
index db28c45..c32d3e8 100644
--- a/solo_tool.py
+++ b/solo_tool.py
@@ -42,16 +42,21 @@ class SoloTool:
def setAbLimits(self, aLimit, bLimit):
self._abController.setLimits(aLimit, bLimit)
- def getAbLimits(self):
+ def getStoredAbLimits(self):
currentSong = self._playlist.getCurrentSong()
if currentSong is not None:
- return self._abController.getLimits(currentSong)
+ return self._abController.getStoredLimits(currentSong)
else:
return list()
def setAbLimitEnable(self, enable):
self._abController.setEnable(enable)
+ def jumpToA(self):
+ a = self._abController.getCurrentLimits()[0]
+ # XXX assumes that player.setPlaybackPosition is thread-safe!
+ self._player.setPlaybackPosition(a)
+
def loadSession(self, path):
with open(path, "r") as f:
self._sessionManager.loadSession(f)
@@ -69,6 +74,9 @@ class SoloTool:
def stop(self):
self._player.stop()
+ def isPlaying(self):
+ return self._player.isPlaying()
+
def setPlaybackRate(self, rate):
self._player.setPlaybackRate(rate)