[vlc-commits] dbus: Add CanGoNext/Previous

Alex Merry git at videolan.org
Wed Jan 30 09:17:09 CET 2013


vlc | branch: master | Alex Merry <dev at randomguy3.me.uk> | Tue Jan 29 00:55:23 2013 +0000| [de67a476d7dc0b384f7517898ee476a82c2635ee] | committer: Mirsal Ennaime

dbus: Add CanGoNext/Previous

These are required by the spec.  We just set them to true, to match the
fact that the buttons on the main interface are never disabled.

Signed-off-by: Mirsal Ennaime <mirsal at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=de67a476d7dc0b384f7517898ee476a82c2635ee
---

 modules/control/dbus/dbus_player.c |   32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/modules/control/dbus/dbus_player.c b/modules/control/dbus/dbus_player.c
index 23b57e4..7ec4e9d 100644
--- a/modules/control/dbus/dbus_player.c
+++ b/modules/control/dbus/dbus_player.c
@@ -280,6 +280,34 @@ DBUS_METHOD( OpenUri )
 }
 
 static int
+MarshalCanGoNext( intf_thread_t *p_intf, DBusMessageIter *container )
+{
+    VLC_UNUSED( p_intf );
+
+    dbus_bool_t b_can_go_next = TRUE;
+
+    if( !dbus_message_iter_append_basic( container, DBUS_TYPE_BOOLEAN,
+                                         &b_can_go_next ) )
+        return VLC_ENOMEM;
+
+    return VLC_SUCCESS;
+}
+
+static int
+MarshalCanGoPrevious( intf_thread_t *p_intf, DBusMessageIter *container )
+{
+    VLC_UNUSED( p_intf );
+
+    dbus_bool_t b_can_go_previous = TRUE;
+
+    if( !dbus_message_iter_append_basic( container, DBUS_TYPE_BOOLEAN,
+                                         &b_can_go_previous ) )
+        return VLC_ENOMEM;
+
+    return VLC_SUCCESS;
+}
+
+static int
 MarshalCanPlay( intf_thread_t *p_intf, DBusMessageIter *container )
 {
     playlist_t *p_playlist = p_intf->p_sys->p_playlist;
@@ -646,6 +674,8 @@ DBUS_METHOD( GetProperty )
     PROPERTY_GET_FUNC( MaximumRate,    "d" )
     PROPERTY_GET_FUNC( CanControl,     "b" )
     PROPERTY_GET_FUNC( CanPlay,        "b" )
+    PROPERTY_GET_FUNC( CanGoNext,      "b" )
+    PROPERTY_GET_FUNC( CanGoPrevious,  "b" )
     PROPERTY_GET_FUNC( CanPause,       "b" )
     PROPERTY_GET_FUNC( CanSeek,        "b" )
     PROPERTY_MAPPING_END
@@ -733,6 +763,8 @@ DBUS_METHOD( GetAllProperties )
     ADD_PROPERTY ( MaximumRate,    "d"     );
     ADD_PROPERTY ( CanControl,     "b"     );
     ADD_PROPERTY ( CanPlay,        "b"     );
+    ADD_PROPERTY ( CanGoNext,      "b"     );
+    ADD_PROPERTY ( CanGoPrevious,  "b"     );
     ADD_PROPERTY ( CanPause,       "b"     );
     ADD_PROPERTY ( CanSeek,        "b"     );
 



More information about the vlc-commits mailing list