aboutsummaryrefslogtreecommitdiffstats
path: root/solo-tool-project/src/solo_tool/handlers.py
diff options
context:
space:
mode:
authorEddy Pedroni <epedroni@pm.me>2025-02-23 13:15:21 +0100
committerEddy Pedroni <epedroni@pm.me>2025-02-23 13:15:21 +0100
commit93ffa46e65433ea4e1ab12d9ef44e3c0d655dc6d (patch)
tree251bf7139602aa40c050fe28448ad20765c1ad7e /solo-tool-project/src/solo_tool/handlers.py
parent54c368d4c0613f215ebce4c01334f8794ce014d7 (diff)
Clean up MIDI controller
Diffstat (limited to 'solo-tool-project/src/solo_tool/handlers.py')
-rw-r--r--solo-tool-project/src/solo_tool/handlers.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/solo-tool-project/src/solo_tool/handlers.py b/solo-tool-project/src/solo_tool/handlers.py
index 0a4ee21..040928c 100644
--- a/solo-tool-project/src/solo_tool/handlers.py
+++ b/solo-tool-project/src/solo_tool/handlers.py
@@ -2,6 +2,14 @@ from collections.abc import Callable
from solo_tool.solo_tool import SoloTool
+def playPause(st: SoloTool) -> Callable[[], None]:
+ def f():
+ if st.isPlaying():
+ st.pause()
+ else:
+ st.play()
+ return f
+
def changeSong(st: SoloTool, delta: int) -> Callable[[], None]:
def f():
if st.song is None:
@@ -33,3 +41,12 @@ def changeKeyPoint(st: SoloTool, delta: int) -> Callable[[], None]:
st.keyPoint = st.keyPoints[new]
return f
+def rateAbsolute(st: SoloTool, value: float) -> Callable[[], None]:
+ def f():
+ st.rate = value
+ return f
+
+def volumeAbsolute(st: SoloTool, value: float) -> Callable[[], None]:
+ def f():
+ st.volume = value
+ return f