diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-01-04 17:55:00 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-01-04 17:55:00 +0100 |
commit | 2b4323eca801638f0a305ff29afe815a45e103b1 (patch) | |
tree | d130038b86d671d78eb52e56ce8d2b9b3bd16842 /midi_controller_launchpad_mini.py | |
parent | c4cb9a96342568890dcf1e36d02d6180bdb26ac8 (diff) |
Added current value to notification system, fixed Qt hack
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) |