[vlc-devel] [PATCH 6/6] Add CanGoNext/Previous to D-Bus interface

Alex Merry dev at randomguy3.me.uk
Tue Jan 29 01:55:23 CET 2013


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.
---
 modules/control/dbus/dbus_player.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/modules/control/dbus/dbus_player.c b/modules/control/dbus/dbus_player.c
index 791d464..0c22648 100644
--- a/modules/control/dbus/dbus_player.c
+++ b/modules/control/dbus/dbus_player.c
@@ -279,6 +279,28 @@ 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;
+
+    dbus_message_iter_append_basic( container, DBUS_TYPE_BOOLEAN, &b_can_go_next );
+    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;
+
+    dbus_message_iter_append_basic( container, DBUS_TYPE_BOOLEAN, &b_can_go_previous );
+    return VLC_SUCCESS;
+}
+
+static int
 MarshalCanPlay( intf_thread_t *p_intf, DBusMessageIter *container )
 {
     playlist_t *p_playlist = p_intf->p_sys->p_playlist;
@@ -629,6 +651,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
@@ -716,6 +740,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"     );
 
-- 
1.8.1.1




More information about the vlc-devel mailing list