Commit 46fb5ca4 authored by Jean-Paul Saman's avatar Jean-Paul Saman

dbus: extend dbus to proposed v2.0 of MPRIS specification.

parent 4a624114
This diff is collapsed.
/*****************************************************************************
* dbus.h : D-Bus control interface
*****************************************************************************
* Copyright (C) 2006 Rafaël Carré
* Copyright (C) 2006-2009 Rafaël Carré
* Copyright (C) 2009 M2X BV
*
* $Id$
*
* Authors: Rafaël Carré <funman at videolanorg>
* Mirsal ENNAIME <mirsal dot ennaime at gmail dot com>
* Jean-Paul Saman <jean-paul dot saman at m2x dot nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -22,8 +25,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_DBUS
#define VLC_DBUS
/* MPRIS VERSION */
#define VLC_MPRIS_VERSION_MAJOR 1
#define VLC_MPRIS_VERSION_MAJOR 2
#define VLC_MPRIS_VERSION_MINOR 0
/* DBUS IDENTIFIERS */
......@@ -34,6 +40,8 @@
#define MPRIS_DBUS_ROOT_PATH "/"
#define MPRIS_DBUS_PLAYER_PATH "/Player"
#define MPRIS_DBUS_TRACKLIST_PATH "/TrackList"
#define MPRIS_DBUS_ES_PATH "/ES"
#define MPRIS_DBUS_DISPLAY_PATH "/Display"
/* MACROS */
......@@ -80,6 +88,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_DOUBLE( d ) DBUS_ADD( DBUS_TYPE_DOUBLE, d )
/* XML data to answer org.freedesktop.DBus.Introspectable.Introspect requests */
......@@ -198,6 +207,13 @@ const char* psz_introspection_xml_data_tracklist =
" <method name=\"SetRandom\">\n"
" <arg type=\"b\" direction=\"in\" />\n"
" </method>\n"
" <method name=\"GetRate\">\n"
" <arg type=\"d\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"SetRate\">\n"
" <arg type=\"d\" direction=\"in\" />\n"
" <arg type=\"i\" direction=\"out\" />\n"
" </method>\n"
" <signal name=\"TrackListChange\">\n"
" <arg type=\"i\" />\n"
" </signal>\n"
......@@ -205,11 +221,91 @@ const char* psz_introspection_xml_data_tracklist =
"</node>\n"
;
const char* psz_introspection_xml_data_es =
"<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\"\n"
"\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n"
"<node>"
" <interface name=\"org.freedesktop.DBus.Introspectable\">\n"
" <method name=\"Introspect\">\n"
" <arg name=\"data\" direction=\"out\" type=\"s\"/>\n"
" </method>\n"
" </interface>\n"
" <interface name=\"org.freedesktop.MediaPlayer\">\n"
" <method name=\"GetVideoES\">\n"
" <arg type=\"i\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"SetVideoES\">\n"
" <arg type=\"i\" direction=\"in\" />\n"
" <arg type=\"i\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"CountVideoES\">\n"
" <arg type=\"i\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"GetAudioES\">\n"
" <arg type=\"i\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"SetAudioES\">\n"
" <arg type=\"i\" direction=\"in\" />\n"
" <arg type=\"i\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"CountAudioES\">\n"
" <arg type=\"s\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"GetSubtitleES\">\n"
" <arg type=\"i\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"SetSubtitleES\">\n"
" <arg type=\"i\" direction=\"in\" />\n"
" <arg type=\"i\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"CountSubtitles\">\n"
" <arg type=\"i\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"GetTeletextPage\">\n"
" <arg type=\"i\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"SetTeletexPage\">\n"
" <arg type=\"i\" direction=\"in\" />\n"
" <arg type=\"i\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"TransparentTeletext\">\n"
" <arg type=\"b\" direction=\"in\" />\n"
" </method>\n"
" <method name=\"GetEsMetadata\">\n"
" <arg type=\"i\" direction=\"in\" />\n"
" <arg type=\"a{sv}\" direction=\"out\" />\n"
" </method>\n"
" </interface>\n"
"</node>\n"
;
const char* psz_introspection_xml_data_display =
"<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\"\n"
"\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n"
"<node>"
" <interface name=\"org.freedesktop.DBus.Introspectable\">\n"
" <method name=\"Introspect\">\n"
" <arg name=\"data\" direction=\"out\" type=\"s\"/>\n"
" </method>\n"
" </interface>\n"
" <interface name=\"org.freedesktop.MediaPlayer\">\n"
" <method name=\"GetVideoPosition\">\n"
" <arg type=\"(iiii)\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"SetVideoPosition\">\n"
" <arg type=\"(iiii)\" direction=\"in\" />\n"
" <arg type=\"i\" direction=\"out\" />\n"
" </method>\n"
" </interface>\n"
"</node>\n"
;
/* Handle messages reception */
DBUS_METHOD( handle_root );
DBUS_METHOD( handle_player );
DBUS_METHOD( handle_tracklist );
DBUS_METHOD( handle_es );
DBUS_METHOD( handle_display );
static const DBusObjectPathVTable vlc_dbus_root_vtable = {
NULL, handle_root, /* handler function */
......@@ -226,3 +322,14 @@ static const DBusObjectPathVTable vlc_dbus_tracklist_vtable = {
NULL, NULL, NULL, NULL
};
static const DBusObjectPathVTable vlc_dbus_es_vtable = {
NULL, handle_es, /* handler function */
NULL, NULL, NULL, NULL
};
static const DBusObjectPathVTable vlc_dbus_display_vtable = {
NULL, handle_display, /* handler function */
NULL, NULL, NULL, NULL
};
#endif /* VLC_DBUS */
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