X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcontrol%2Fdbus.h;h=929588b8a54e62ad75e85e0b12a04f4cffa2fb35;hb=086a3600d6ba6fc7d9b44cbb42d37a5572102854;hp=cad2ce42f6fe2db06111a1012c43d1ff54efb37b;hpb=8c432e88f6a512ce6723965256d2a37a5ee39c23;p=vlc diff --git a/modules/control/dbus.h b/modules/control/dbus.h index cad2ce42f6..929588b8a5 100644 --- a/modules/control/dbus.h +++ b/modules/control/dbus.h @@ -22,21 +22,24 @@ * 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 */ -#define VLC_DBUS_SERVICE "org.freedesktop.MediaPlayer" -#define VLC_DBUS_INTERFACE "org.freedesktop.MediaPlayer" -#define VLC_DBUS_ROOT_PATH "/" -#define VLC_DBUS_PLAYER_PATH "/Player" -#define VLC_DBUS_TRACKLIST_PATH "/TrackList" +#define VLC_MPRIS_DBUS_SERVICE "org.mpris.vlc" +#define MPRIS_DBUS_INTERFACE "org.freedesktop.MediaPlayer" +#define MPRIS_DBUS_ROOT_PATH "/" +#define MPRIS_DBUS_PLAYER_PATH "/Player" +#define MPRIS_DBUS_TRACKLIST_PATH "/TrackList" /* MACROS */ -/* DBus related */ #define DBUS_METHOD( method_function ) \ static DBusHandlerResult method_function \ - ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this ) + ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this ) #define DBUS_SIGNAL( signal_function ) \ static DBusHandlerResult signal_function \ @@ -54,8 +57,8 @@ return DBUS_HANDLER_RESULT_HANDLED #define SIGNAL_INIT( signal ) \ - DBusMessage *p_msg = dbus_message_new_signal( VLC_DBUS_PLAYER_PATH, \ - VLC_DBUS_INTERFACE, signal ); \ + DBusMessage *p_msg = dbus_message_new_signal( MPRIS_DBUS_PLAYER_PATH, \ + MPRIS_DBUS_INTERFACE, signal ); \ if( !p_msg ) return DBUS_HANDLER_RESULT_NEED_MEMORY; \ #define SIGNAL_SEND \ @@ -78,17 +81,14 @@ #define ADD_INT32( i ) DBUS_ADD( DBUS_TYPE_INT32, i ) #define ADD_BYTE( b ) DBUS_ADD( DBUS_TYPE_BYTE, b ) -/* VLC related */ -#define TEST_NEXT \ - p_tested_item = playlist_GetNextLeaf( p_playlist, \ - p_playlist->p_root_onelevel, p_tested_item, VLC_FALSE, VLC_FALSE ); - /* XML data to answer org.freedesktop.DBus.Introspectable.Introspect requests */ const char* psz_introspection_xml_data_root = "\n" -"" +"\n" +" \n" +" \n" " \n" " \n" " \n" @@ -98,6 +98,11 @@ const char* psz_introspection_xml_data_root = " \n" " \n" " \n" +" \n" +" \n" +" \n" +" \n" +" \n" " \n" "\n" ; @@ -111,11 +116,9 @@ const char* psz_introspection_xml_data_player = " \n" " \n" " \n" -" \n" +" \n" " \n" -" \n" -" \n" -" \n" +" \n" " \n" " \n" " \n" @@ -127,6 +130,9 @@ const char* psz_introspection_xml_data_player = " \n" " \n" " \n" +" \n" +" \n" +" \n" " \n" " \n" " \n" @@ -142,6 +148,18 @@ const char* psz_introspection_xml_data_player = " \n" " \n" " \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" " \n" "\n" ; @@ -155,10 +173,11 @@ const char* psz_introspection_xml_data_tracklist = " \n" " \n" " \n" -" \n" +" \n" " \n" " \n" " \n" +" \n" " \n" " \n" " \n" @@ -173,39 +192,36 @@ const char* psz_introspection_xml_data_tracklist = " \n" " \n" " \n" -" \n" -" \n" -" \n" -" \n" +" \n" " \n" " \n" -" \n" +" \n" " \n" " \n" +" \n" +" \n" +" \n" " \n" "\n" ; -#define VLC_DBUS_ROOT_PATH "/" -#define VLC_DBUS_PLAYER_PATH "/Player" -#define VLC_DBUS_TRACKLIST_PATH "/TrackList" /* Handle messages reception */ DBUS_METHOD( handle_root ); DBUS_METHOD( handle_player ); DBUS_METHOD( handle_tracklist ); -static DBusObjectPathVTable vlc_dbus_root_vtable = { +static const DBusObjectPathVTable vlc_dbus_root_vtable = { NULL, handle_root, /* handler function */ NULL, NULL, NULL, NULL }; -static DBusObjectPathVTable vlc_dbus_player_vtable = { +static const DBusObjectPathVTable vlc_dbus_player_vtable = { NULL, handle_player, /* handler function */ NULL, NULL, NULL, NULL }; -static DBusObjectPathVTable vlc_dbus_tracklist_vtable = { +static const DBusObjectPathVTable vlc_dbus_tracklist_vtable = { NULL, handle_tracklist, /* handler function */ NULL, NULL, NULL, NULL };