aboutsummaryrefslogtreecommitdiffstats
path: root/solo-tool-project
diff options
context:
space:
mode:
authorEddy Pedroni <epedroni@pm.me>2025-02-26 21:44:02 +0100
committerEddy Pedroni <epedroni@pm.me>2025-02-26 21:44:02 +0100
commitebdf82d603befc24e13a061eaffa6dc183a72f14 (patch)
treeb03dbc171981fc3973f54be0e0ba798ef47c310d /solo-tool-project
parent3c065ceded2a58d5aadbcf64417f2cfc92268a08 (diff)
Improve web UI
Diffstat (limited to 'solo-tool-project')
-rw-r--r--solo-tool-project/src/solo_tool/handlers.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/solo-tool-project/src/solo_tool/handlers.py b/solo-tool-project/src/solo_tool/handlers.py
index ab7309e..0b38968 100644
--- a/solo-tool-project/src/solo_tool/handlers.py
+++ b/solo-tool-project/src/solo_tool/handlers.py
@@ -18,6 +18,14 @@ def changeSong(st: SoloTool, delta: int) -> Callable[[], None]:
st.song += delta
return f
+def restartOrPreviousSong(st: SoloTool, threshold: float) -> Callable[[], None]:
+ def f():
+ if st.position < threshold and st.song > 0:
+ st.song -= 1
+ else:
+ st.position = 0.0
+ return f
+
def setSong(st: SoloTool, index: int, followUp: Callable[[], None]=None) -> Callable[[], None]:
def f():
st.song = index