aboutsummaryrefslogtreecommitdiffstats
path: root/notifier.py
diff options
context:
space:
mode:
Diffstat (limited to 'notifier.py')
-rw-r--r--notifier.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/notifier.py b/notifier.py
index 1a68c56..e052b5c 100644
--- a/notifier.py
+++ b/notifier.py
@@ -2,8 +2,10 @@
class Notifier:
PLAYING_STATE_EVENT = 0
- def __init__(self):
+ def __init__(self, player):
self._callbacks = dict()
+ self._player = player
+ self._player.setPlayingStateChangedCallback(self._playingStateChangedCallback)
def registerCallback(self, event, callback):
if event not in self._callbacks:
@@ -13,3 +15,6 @@ class Notifier:
def notify(self, event):
for callback in self._callbacks.get(event, list()):
callback()
+
+ def _playingStateChangedCallback(self, *args):
+ self.notify(Notifier.PLAYING_STATE_EVENT)