Commit 678f97a6 authored by Mirsal Ennaime's avatar Mirsal Ennaime Committed by Rafaël Carré

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

Signed-off-by: default avatarRafaël Carré <funman@videolan.org>
parent b3390752
......@@ -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;
}
......
......@@ -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"
;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment