aboutsummaryrefslogtreecommitdiffstats
path: root/solo-tool-project/src/solo_tool/handlers.py
blob: 13e982b087cc0fea6301efde35cffdf4a70fe5b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from collections.abc import Callable

from solo_tool.solo_tool import SoloTool

def changeSong(st: SoloTool, delta: int) -> Callable[[], None]:
    def f():
        if st.song is None:
            st.song = 0
        else:
            st.song += delta
    return f

def seekRelative(st: SoloTool, delta: float) -> Callable[[], None]:
    def f():
        st.position += delta
    return f

def positionToKeyPoint(st: SoloTool) -> Callable[[], None]:
    def f():
        st.keyPoint = st.position
    return f