From eaec524a233c9ee11023f21d430bcbc2f4d5a17e Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Sat, 22 Feb 2025 08:17:29 +0100 Subject: Moved nextSong and previousSong to SoloToolController --- .../src/solo_tool/solo_tool_controller.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 solo-tool-project/src/solo_tool/solo_tool_controller.py (limited to 'solo-tool-project/src/solo_tool/solo_tool_controller.py') 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) + -- cgit v1.2.3