From 2b4323eca801638f0a305ff29afe815a45e103b1 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Tue, 4 Jan 2022 17:55:00 +0100 Subject: Added current value to notification system, fixed Qt hack --- midi_controller_launchpad_mini.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'midi_controller_launchpad_mini.py') 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) -- cgit v1.2.3