Send new time position to 'seeked' listeners
This commit is contained in:
parent
28e5ed8b2e
commit
12d6ce53dd
@ -495,7 +495,7 @@ class PlaybackController(object):
|
||||
|
||||
success = self.provider.seek(time_position)
|
||||
if success:
|
||||
self._trigger_seeked()
|
||||
self._trigger_seeked(time_position)
|
||||
return success
|
||||
|
||||
def stop(self, clear_current_track=False):
|
||||
@ -553,6 +553,6 @@ class PlaybackController(object):
|
||||
logger.debug(u'Triggering options changed event')
|
||||
BackendListener.send('options_changed')
|
||||
|
||||
def _trigger_seeked(self):
|
||||
def _trigger_seeked(self, time_position):
|
||||
logger.debug(u'Triggering seeked event')
|
||||
BackendListener.send('seeked')
|
||||
BackendListener.send('seeked', time_position=time_position)
|
||||
|
||||
@ -111,11 +111,14 @@ class BackendListener(object):
|
||||
"""
|
||||
pass
|
||||
|
||||
def seeked(self):
|
||||
def seeked(self, time_position):
|
||||
"""
|
||||
Called whenever the time position changes by an unexpected amount, e.g.
|
||||
at seek to a new time position.
|
||||
|
||||
*MAY* be implemented by actor.
|
||||
|
||||
:param time_position: the position that was seeked to in milliseconds
|
||||
:type time_position: int
|
||||
"""
|
||||
pass
|
||||
|
||||
@ -35,4 +35,4 @@ class BackendListenerTest(unittest.TestCase):
|
||||
self.listener.volume_changed()
|
||||
|
||||
def test_listener_has_default_impl_for_seeked(self):
|
||||
self.listener.seeked()
|
||||
self.listener.seeked(0)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user