[vlc-devel] commit: Dbus control module: * Add the MprisVersion Method. * The MPRIS 1. 0 implementation is now complete. (Mirsal Ennaime )

git version control git at videolan.org
Thu Mar 27 01:11:10 CET 2008


vlc | branch: master | Mirsal Ennaime <mirsal.ennaime at gmail.com> | Tue Mar 25 03:43:27 2008 +0100| [678f97a658be15939b2b72e455f338a9de4a8da1]

Dbus control module: * Add the MprisVersion Method. * The MPRIS 1.0 implementation is now complete.

Signed-off-by: Rafaël Carré <funman at videolan.org>

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

 modules/control/dbus.c |   17 +++++++++++++++++
 modules/control/dbus.h |    8 ++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/modules/control/dbus.c b/modules/control/dbus.c
index 54739d7..ec2914d 100644
--- a/modules/control/dbus.c
+++ b/modules/control/dbus.c
@@ -127,6 +127,22 @@ DBUS_METHOD( Quit )
     REPLY_SEND;
 }
 
+DBUS_METHOD( MprisVersion )
+{ /*implemented version of the mpris spec */
+    REPLY_INIT;
+    OUT_ARGUMENTS;
+    VLC_UNUSED( p_this );
+    dbus_uint16_t i_major = VLC_MPRIS_VERSION_MAJOR;
+    dbus_uint16_t i_minor = VLC_MPRIS_VERSION_MINOR;
+    DBusMessageIter version;
+
+    dbus_message_iter_open_container( &args, DBUS_TYPE_STRUCT, NULL, &version );
+    dbus_message_iter_append_basic( &version, DBUS_TYPE_UINT16, &i_major );
+    dbus_message_iter_append_basic( &version, DBUS_TYPE_UINT16, &i_minor );
+    dbus_message_iter_close_container( &args, &version );
+    REPLY_SEND;
+}
+
 DBUS_METHOD( PositionGet )
 { /* returns position in milliseconds */
     REPLY_INIT;
@@ -605,6 +621,7 @@ DBUS_METHOD( handle_root )
     /* here D-Bus method's names are associated to an handler */
 
     METHOD_FUNC( "Identity",                Identity );
+    METHOD_FUNC( "MprisVersion",            MprisVersion );
 
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
diff --git a/modules/control/dbus.h b/modules/control/dbus.h
index bc39fa0..c9057d7 100644
--- a/modules/control/dbus.h
+++ b/modules/control/dbus.h
@@ -22,6 +22,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+/* MPRIS VERSION */
+#define VLC_MPRIS_VERSION_MAJOR     1
+#define VLC_MPRIS_VERSION_MINOR     0
+
 /* DBUS IDENTIFIERS */
 
 /* name registered on the session bus */
@@ -76,6 +80,7 @@
 #define ADD_BOOL( b ) DBUS_ADD( DBUS_TYPE_BOOLEAN, b )
 #define ADD_INT32( i ) DBUS_ADD( DBUS_TYPE_INT32, i )
 #define ADD_BYTE( b ) DBUS_ADD( DBUS_TYPE_BYTE, b )
+#define ADD_UINT16( i ) DBUS_ADD( DBUS_TYPE_UINT16, i )
 
 /* XML data to answer org.freedesktop.DBus.Introspectable.Introspect requests */
 
@@ -94,6 +99,9 @@ const char* psz_introspection_xml_data_root =
 "    <method name=\"Identity\">\n"
 "      <arg type=\"s\" direction=\"out\" />\n"
 "    </method>\n"
+"    <method name=\"MprisVersion\">\n"
+"      <arg type=\"(qq)\" direction=\"out\" />\n"
+"    </method>\n"
 "  </interface>\n"
 "</node>\n"
 ;




More information about the vlc-devel mailing list