aboutsummaryrefslogtreecommitdiffstats
path: root/solo_tool.py
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2021-12-22 10:59:12 +0100
committerEddy Pedroni <eddy@0xf7.com>2021-12-22 10:59:12 +0100
commit96a574d317ccbbff3af3f1a20755c3b79f873510 (patch)
tree664c38b4963a39d8dc709b5b5477a3a16ce6f766 /solo_tool.py
parent2aba13e9ab112e1aeb80b8f8f946c463ab76348b (diff)
Added load/save integration tests, test assets
Diffstat (limited to 'solo_tool.py')
-rw-r--r--solo_tool.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/solo_tool.py b/solo_tool.py
index ff0f768..53670fb 100644
--- a/solo_tool.py
+++ b/solo_tool.py
@@ -7,7 +7,7 @@ class SoloTool:
def __init__(self, player=None):
self._player = Player() if player is None else player
self._playlist = Playlist(self._playlistCallback)
- self._abController = ABController(callback=self._abControllerCallback)
+ self._abController = ABController(enabled=False, callback=self._abControllerCallback)
self._sessionManager = SessionManager(self._playlist, self._abController)
def _playlistCallback(self, path):
@@ -17,6 +17,10 @@ class SoloTool:
def _abControllerCallback(self, position):
self._player.setPlaybackPosition(position)
+ def tick(self):
+ position = self._player.getPlaybackPosition()
+ self._abController.positionChanged(position)
+
def addSong(self, path):
self._sessionManager.addSong(path)
@@ -29,14 +33,17 @@ class SoloTool:
def setAbLimit(self, index):
self._abController.setCurrentLimits(0)
- def tick(self):
- position = self._player.getPlaybackPosition()
- self._abController.positionChanged(position)
-
+ def setAbLimitEnable(self, enable):
+ self._abController.setEnable(enable)
+
def loadSession(self, path):
with open(path, "r") as f:
self._sessionManager.loadSession(f)
+ def saveSession(self, path):
+ with open(path, "w") as f:
+ self._sessionManager.saveSession(f)
+
# Playback control
def play(self):
self._player.play()