aboutsummaryrefslogtreecommitdiffstats
path: root/solo_tool.py
diff options
context:
space:
mode:
Diffstat (limited to 'solo_tool.py')
-rw-r--r--solo_tool.py18
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)
+