aboutsummaryrefslogtreecommitdiffstats
path: root/solo_tool.py
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2021-12-21 19:32:11 +0100
committerEddy Pedroni <eddy@0xf7.com>2021-12-21 19:32:11 +0100
commitae8f0a04190c3d13292ad68548f5275507e5812e (patch)
tree1bc207715280e6e9a1b99a84f9435e98d15bda1b /solo_tool.py
parent9ee7ee992d468b4f354ac16c34747e0c31d7b656 (diff)
Added some integration tests, refactored playlist, updated diagram
Diffstat (limited to 'solo_tool.py')
-rw-r--r--solo_tool.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/solo_tool.py b/solo_tool.py
new file mode 100644
index 0000000..da1a402
--- /dev/null
+++ b/solo_tool.py
@@ -0,0 +1,37 @@
+from playlist import Playlist
+from abcontroller import ABController
+from session_manager import SessionManager
+from player_vlc import Player
+
+class SoloTool:
+ def __init__(self, player=None):
+ self._player = Player() if player is None else player
+ self._playlist = Playlist(self._player)
+ self._abController = ABController()
+ self._sessionManager = SessionManager(self._playlist, self._abController)
+
+ def addSong(self, path):
+ self._sessionManager.addSong(path)
+
+ def setSong(self, index):
+ self._playlist.setCurrentSong(index)
+
+ # Playback control
+ def play(self):
+ self._player.play()
+
+ def pause(self):
+ self._player.pause()
+
+ def stop(self):
+ self._player.stop()
+
+ def setPlaybackRate(self, rate):
+ self._player.setPlaybackRate(rate)
+
+ def setPlaybackPosition(self, position):
+ self._player.setPlaybackPosition(position)
+
+ def setPlaybackVolume(self, volume):
+ self._player.setPlaybackVolume(volume)
+