Add Next, Prev, and Stop methods
authorRafaël Carré <funman@videolan.org>
Sat, 18 Nov 2006 22:19:40 +0000 (22:19 +0000)
committerRafaël Carré <funman@videolan.org>
Sat, 18 Nov 2006 22:19:40 +0000 (22:19 +0000)
modules/control/dbus.c
modules/control/dbus.h

index 11349dd..57f4c85 100644 (file)
@@ -109,6 +109,32 @@ DBUS_METHOD( Quit )
     REPLY_SEND;
 }
 
+DBUS_METHOD( Next )
+{ /* next playlist item */
+    REPLY_INIT;
+    playlist_t *p_playlist = pl_Yield( ((vlc_object_t*) p_this) );
+    playlist_Next( p_playlist );
+    pl_Release( ((vlc_object_t*) p_this) );
+    REPLY_SEND;
+}
+
+DBUS_METHOD( Prev )
+{ /* previous playlist item */
+    REPLY_INIT;
+    playlist_t *p_playlist = pl_Yield( ((vlc_object_t*) p_this) );
+    playlist_Prev( p_playlist );
+    pl_Release( ((vlc_object_t*) p_this) );
+    REPLY_SEND;
+}
+
+DBUS_METHOD( Stop )
+{ /* stop playing */
+    REPLY_INIT;
+    playlist_t *p_playlist = pl_Yield( ((vlc_object_t*) p_this) );
+    playlist_Stop( p_playlist );
+    pl_Release( ((vlc_object_t*) p_this) );
+    REPLY_SEND;
+}
 DBUS_METHOD( GetPlayStatus )
 { /* return a string */
     REPLY_INIT;
@@ -249,7 +275,10 @@ DBUS_METHOD( handle_messages )
     METHOD_FUNC( "AddMRL",          AddMRL );
     METHOD_FUNC( "TogglePause",     TogglePause );
     METHOD_FUNC( "Nothing",         Nothing );
+    METHOD_FUNC( "Prev",            Prev );
+    METHOD_FUNC( "Next",            Next );
     METHOD_FUNC( "Quit",            Quit );
+    METHOD_FUNC( "Stop",            Stop );
 
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
index 957d470..f0e5fc0 100644 (file)
@@ -100,6 +100,12 @@ const char* psz_introspection_xml_data =
 "    </method>\n"
 "    <method name=\"Quit\">\n"
 "    </method>\n"
+"    <method name=\"Prev\">\n"
+"    </method>\n"
+"    <method name=\"Next\">\n"
+"    </method>\n"
+"    <method name=\"Stop\">\n"
+"    </method>\n"
 "  </interface>\n"
 "</node>\n"
 ;