Added quit method
authorRafaël Carré <funman@videolan.org>
Sat, 18 Nov 2006 20:26:51 +0000 (20:26 +0000)
committerRafaël Carré <funman@videolan.org>
Sat, 18 Nov 2006 20:26:51 +0000 (20:26 +0000)
modules/control/dbus.c
modules/control/dbus.h

index 0b8f392..11349dd 100644 (file)
@@ -99,6 +99,16 @@ DBUS_METHOD( Nothing )
     REPLY_SEND;
 }
 
+DBUS_METHOD( Quit )
+{ /* exits vlc */
+    REPLY_INIT;
+    playlist_t *p_playlist = pl_Yield( (vlc_object_t*) p_this );
+    playlist_Stop( p_playlist );
+    pl_Release( ((vlc_object_t*) p_this) );
+    ((vlc_object_t*)p_this)->b_die = VLC_TRUE;
+    REPLY_SEND;
+}
+
 DBUS_METHOD( GetPlayStatus )
 { /* return a string */
     REPLY_INIT;
@@ -239,6 +249,7 @@ DBUS_METHOD( handle_messages )
     METHOD_FUNC( "AddMRL",          AddMRL );
     METHOD_FUNC( "TogglePause",     TogglePause );
     METHOD_FUNC( "Nothing",         Nothing );
+    METHOD_FUNC( "Quit",            Quit );
 
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
index 533911a..c4443ba 100644 (file)
@@ -97,6 +97,7 @@ const char* psz_introspection_xml_data =
 "      <arg type=\"b\" direction=\"in\" />\n"
 "    </method>\n"
 "    <method name=\"Nothing\">\n"
+"    <method name=\"Quit\">\n"
 "    </method>\n"
 "  </interface>\n"
 "</node>\n"