def _trigger_track_playback_ended(self): logger.debug(u'Triggering track playback ended event') if self.current_track is None: return BackendListener.send('track_playback_ended', track=self.current_track, time_position=self.time_position)
def _trigger_seeked(self): logger.debug(u'Triggering seeked event') BackendListener.send('seeked')
def _trigger_options_changed(self): logger.debug(u'Triggering options changed event') BackendListener.send('options_changed')
def _trigger_playback_state_changed(self): logger.debug(u'Triggering playback state change event') BackendListener.send('playback_state_changed')
def _trigger_track_playback_started(self): logger.debug(u'Triggering track playback started event') if self.current_track is None: return BackendListener.send('track_playback_started', track=self.current_track)
def setUp(self): self.listener = BackendListener()
class BackendListenerTest(unittest.TestCase): def setUp(self): self.listener = BackendListener() def test_listener_has_default_impl_for_track_playback_paused(self): self.listener.track_playback_paused(Track(), 0) def test_listener_has_default_impl_for_track_playback_resumed(self): self.listener.track_playback_resumed(Track(), 0) def test_listener_has_default_impl_for_track_playback_started(self): self.listener.track_playback_started(Track()) def test_listener_has_default_impl_for_track_playback_ended(self): self.listener.track_playback_ended(Track(), 0) def test_listener_has_default_impl_for_playback_state_changed(self): self.listener.playback_state_changed() def test_listener_has_default_impl_for_playlist_changed(self): self.listener.playlist_changed() def test_listener_has_default_impl_for_options_changed(self): self.listener.options_changed() def test_listener_has_default_impl_for_volume_changed(self): self.listener.volume_changed() def test_listener_has_default_impl_for_seeked(self): self.listener.seeked()
def _trigger_playlist_changed(self): logger.debug(u'Triggering playlist changed event') BackendListener.send('playlist_changed')