aboutsummaryrefslogtreecommitdiffstats
path: root/midi_controller_launchpad_mini.py
diff options
context:
space:
mode:
Diffstat (limited to 'midi_controller_launchpad_mini.py')
-rw-r--r--midi_controller_launchpad_mini.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/midi_controller_launchpad_mini.py b/midi_controller_launchpad_mini.py
index 3bcef13..cb3bc37 100644
--- a/midi_controller_launchpad_mini.py
+++ b/midi_controller_launchpad_mini.py
@@ -25,7 +25,7 @@ class MidiController:
self._midiWrapper = MidiWrapper()
self._registerHandlers()
-
+ self._soloTool.registerPlayingStateCallback(self._updatePlayPauseButton)
def _registerHandlers(self):
self._handlers = {
@@ -61,14 +61,17 @@ class MidiController:
def _playPause(self):
if self._soloTool.isPlaying():
self._soloTool.pause()
- self._setButtonLED(7, 0, MidiController.LED_YELLOW)
else:
self._soloTool.play()
- self._setButtonLED(7, 0, MidiController.LED_GREEN)
def _stop(self):
self._soloTool.stop()
- self._setButtonLED(7, 0, MidiController.LED_YELLOW)
+
+ def _updatePlayPauseButton(self):
+ if self._soloTool.isPlaying():
+ self._setButtonLED(7, 0, MidiController.LED_GREEN)
+ else:
+ self._setButtonLED(7, 0, MidiController.LED_YELLOW)
def _createSetPlaybackRateCallback(self, rate, column):
def f():