diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-01-04 13:49:38 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-01-04 13:49:38 +0100 |
commit | edb2ffc66231702c931429ab44ad5009abb8c128 (patch) | |
tree | 6b1ad17f45aaf35a8cf0f3cedf03ac71c6611d6c /solo_tool.py | |
parent | 67f07cf01155b98321f590e3c18e378018c0a624 (diff) |
Added proper volume and playback rate feedback, changed volume steps in MIDI interface
Diffstat (limited to 'solo_tool.py')
-rw-r--r-- | solo_tool.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/solo_tool.py b/solo_tool.py index f52e074..7933fce 100644 --- a/solo_tool.py +++ b/solo_tool.py @@ -92,7 +92,13 @@ class SoloTool: return self._player.isPlaying() def setPlaybackRate(self, rate): + previousRate = self._player.getPlaybackRate() self._player.setPlaybackRate(rate) + if previousRate != rate: + self._notifier.notify(Notifier.PLAYBACK_RATE_EVENT) + + def getPlaybackRate(self): + return self._player.getPlaybackRate() def setPlaybackPosition(self, position): self._player.setPlaybackPosition(position) @@ -101,8 +107,20 @@ class SoloTool: return self._player.getPlaybackPosition() def setPlaybackVolume(self, volume): + previousVolume = self._player.getPlaybackVolume() self._player.setPlaybackVolume(volume) + if previousVolume != volume: + self._notifier.notify(Notifier.PLAYBACK_VOLUME_EVENT) + + def getPlaybackVolume(self): + return self._player.getPlaybackVolume() def registerPlayingStateCallback(self, callback): self._notifier.registerCallback(Notifier.PLAYING_STATE_EVENT, callback) + def registerPlaybackVolumeCallback(self, callback): + self._notifier.registerCallback(Notifier.PLAYBACK_VOLUME_EVENT, callback) + + def registerPlaybackRateCallback(self, callback): + self._notifier.registerCallback(Notifier.PLAYBACK_RATE_EVENT, callback) + |