From 71f6a49110b6696ca6ac7956baa4edaa1aaa9527 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Sat, 1 Jan 2022 10:18:37 +0100 Subject: Added partial Launchpad support, refactored existing files --- solo_tool.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'solo_tool.py') 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) -- cgit v1.2.3