Test and implement mpris.CanControl property
This commit is contained in:
parent
22cba6f75c
commit
a4d73a8d7e
@ -157,8 +157,7 @@ class MprisObject(dbus.service.Object):
|
|||||||
'CanPause': (False, None),
|
'CanPause': (False, None),
|
||||||
# TODO Set to True when the rest is implemented
|
# TODO Set to True when the rest is implemented
|
||||||
'CanSeek': (False, None),
|
'CanSeek': (False, None),
|
||||||
# TODO Set to True when the rest is implemented
|
'CanControl': (self.get_CanControl, None),
|
||||||
'CanControl': (False, None),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def _connect_to_dbus(self):
|
def _connect_to_dbus(self):
|
||||||
@ -386,3 +385,7 @@ class MprisObject(dbus.service.Object):
|
|||||||
|
|
||||||
def get_Position(self):
|
def get_Position(self):
|
||||||
return self.backend.playback.time_position.get() * 1000
|
return self.backend.playback.time_position.get() * 1000
|
||||||
|
|
||||||
|
def get_CanControl(self):
|
||||||
|
# TODO This could be a setting for the end user to change.
|
||||||
|
return True
|
||||||
|
|||||||
@ -157,6 +157,10 @@ class PlayerInterfaceTest(unittest.TestCase):
|
|||||||
result = self.mpris.Get(mpris.PLAYER_IFACE, 'MaximumRate')
|
result = self.mpris.Get(mpris.PLAYER_IFACE, 'MaximumRate')
|
||||||
self.assert_(result >= 1.0)
|
self.assert_(result >= 1.0)
|
||||||
|
|
||||||
|
def test_can_control_is_true(self):
|
||||||
|
result = self.mpris.Get(mpris.PLAYER_IFACE, 'CanControl')
|
||||||
|
self.assertTrue(result)
|
||||||
|
|
||||||
def test_next_when_playing_should_skip_to_next_track_and_keep_playing(self):
|
def test_next_when_playing_should_skip_to_next_track_and_keep_playing(self):
|
||||||
self.backend.current_playlist.append([Track(uri='a'), Track(uri='b')])
|
self.backend.current_playlist.append([Track(uri='a'), Track(uri='b')])
|
||||||
self.backend.playback.play()
|
self.backend.playback.play()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user