diff options
Diffstat (limited to 'midi_controller_launchpad_mini.py')
-rw-r--r-- | midi_controller_launchpad_mini.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/midi_controller_launchpad_mini.py b/midi_controller_launchpad_mini.py index 10013b5..6790cec 100644 --- a/midi_controller_launchpad_mini.py +++ b/midi_controller_launchpad_mini.py @@ -69,21 +69,19 @@ class MidiController: def _stop(self): self._soloTool.stop() - def _updatePlayPauseButton(self): - if self._soloTool.isPlaying(): + def _updatePlayPauseButton(self, playing): + if playing: self._setButtonLED(7, 0, MidiController.LED_GREEN) else: self._setButtonLED(7, 0, MidiController.LED_YELLOW) - def _updateVolumeRow(self): - volume = self._soloTool.getPlaybackVolume() + def _updateVolumeRow(self, volume): t1 = int(round(volume / MidiController.PLAYBACK_VOLUME_STEP, 1)) t2 = int(round(MidiController.MIN_PLAYBACK_VOLUME / MidiController.PLAYBACK_VOLUME_STEP, 1)) lastColumnLit = t1 - t2 + 1 self._lightRowUntilColumn(0, lastColumnLit, MidiController.LED_GREEN) - def _updateRateRow(self): - rate = self._soloTool.getPlaybackRate() + def _updateRateRow(self, rate): t1 = int(round(rate / MidiController.PLAYBACK_RATE_STEP, 1)) t2 = int(round(MidiController.MIN_PLAYBACK_RATE / MidiController.PLAYBACK_RATE_STEP, 1)) lastColumnLit = t1 - t2 + 1 @@ -116,14 +114,14 @@ class MidiController: self._allLEDsOff() # volume buttons - self._updateVolumeRow() + self._updateVolumeRow(self._soloTool.getPlaybackVolume()) # playback rate buttons - self._updateRateRow() + self._updateRateRow(self._soloTool.getPlaybackRate()) # playback control self._setButtonLED(6, 0, MidiController.LED_RED) - self._updatePlayPauseButton() + self._updatePlayPauseButton(self._soloTool.isPlaying()) # AB control self._setButtonLED(6, 5, MidiController.LED_YELLOW) |