aboutsummaryrefslogtreecommitdiffstats
path: root/solo-tool-project/src/solo_tool/solo_tool_controller.py
diff options
context:
space:
mode:
authorEddy Pedroni <epedroni@pm.me>2025-02-22 08:17:29 +0100
committerEddy Pedroni <epedroni@pm.me>2025-02-22 08:17:29 +0100
commiteaec524a233c9ee11023f21d430bcbc2f4d5a17e (patch)
tree9028a1879aaa07c373bd51198f6aed60eb6dfd1b /solo-tool-project/src/solo_tool/solo_tool_controller.py
parentb676f88b21ef8046dcd3d9dac4b270007f2b959a (diff)
Moved nextSong and previousSong to SoloToolController
Diffstat (limited to 'solo-tool-project/src/solo_tool/solo_tool_controller.py')
-rw-r--r--solo-tool-project/src/solo_tool/solo_tool_controller.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/solo-tool-project/src/solo_tool/solo_tool_controller.py b/solo-tool-project/src/solo_tool/solo_tool_controller.py
new file mode 100644
index 0000000..d283725
--- /dev/null
+++ b/solo-tool-project/src/solo_tool/solo_tool_controller.py
@@ -0,0 +1,22 @@
+import os
+
+from solo_tool.solo_tool import SoloTool
+
+class SoloToolController:
+ def __init__(self, soloTool: SoloTool):
+ self._soloTool = soloTool
+
+ def nextSong(self):
+ current = self._soloTool.getCurrentSong()
+ if current is None:
+ self._soloTool.setSong(0)
+ else:
+ self._soloTool.setSong(current + 1)
+
+ def previousSong(self):
+ current = self._soloTool.getCurrentSong()
+ if current is None:
+ self._soloTool.setSong(0)
+ else:
+ self._soloTool.setSong(current - 1)
+