]> git.sesse.net Git - vlc/commitdiff
dbus: Add CanGoNext/Previous
authorAlex Merry <dev@randomguy3.me.uk>
Tue, 29 Jan 2013 00:55:23 +0000 (00:55 +0000)
committerMirsal Ennaime <mirsal@videolan.org>
Wed, 30 Jan 2013 06:26:01 +0000 (07:26 +0100)
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@videolan.org>
modules/control/dbus/dbus_player.c

index 23b57e40cc0f12157db1cc60ac1f3bf637ba90b0..7ec4e9ddfff707c12430d968e0be8553b43ec017 100644 (file)
@@ -279,6 +279,34 @@ DBUS_METHOD( OpenUri )
     REPLY_SEND;
 }
 
+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 )
 {
@@ -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"     );