diff options
Diffstat (limited to 'solo-tool-project/src/solo_tool/handlers.py')
-rw-r--r-- | solo-tool-project/src/solo_tool/handlers.py | 17 |
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 |