diff options
Diffstat (limited to 'solo_tool_cli.py')
-rw-r--r-- | solo_tool_cli.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/solo_tool_cli.py b/solo_tool_cli.py index 8d53a33..43e3a9d 100644 --- a/solo_tool_cli.py +++ b/solo_tool_cli.py @@ -1,10 +1,12 @@ import sys +import time +import threading from solo_tool import SoloTool from midi_controller_launchpad_mini import MidiController class SoloToolCLI: - def __init__(self, sessionJson, soloToolOverride=None, midiOverride=None): + def __init__(self, sessionJson, soloToolOverride=None, midiOverride=None, tickEnable=True): self._soloTool = SoloTool() if soloToolOverride is None else soloToolOverride self._soloTool.loadSession(sessionJson) self._midiController = MidiController(self._soloTool) if midiOverride is None else midiOverride @@ -12,6 +14,8 @@ class SoloToolCLI: "song" : self._song, "midi" : self._midi } + if tickEnable: + self._tick() def input(self, commandString): split = commandString.strip().split(" ") @@ -34,6 +38,10 @@ class SoloToolCLI: else: print("Supported device: Novation Launchpad Mini MkII") + def _tick(self): + self._soloTool.tick() + threading.Timer(0.1, self._tick).start() + def main(args): if len(args) == 0: print("Please provide path to session file") |