X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcontrol%2Fdbus.h;h=40dfde1037f465e62c30887eff8239f948df7df9;hb=32b31e87d90967549e5cc8bef18d5aae7e3b98c6;hp=43a3c6314e676d0452c4f281e2f2f715fc78c7f1;hpb=460774aa07c637f6ef7af1cfe2371d759c2bc5ab;p=vlc diff --git a/modules/control/dbus.h b/modules/control/dbus.h index 43a3c6314e..40dfde1037 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,13 +57,13 @@ 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 \ if( !dbus_connection_send( p_conn, p_msg, NULL ) ) \ - return DBUS_HANDLER_RESULT_NEED_MEMORY; \ + return DBUS_HANDLER_RESULT_NEED_MEMORY; \ dbus_message_unref( p_msg ); \ dbus_connection_flush( p_conn ); \ return DBUS_HANDLER_RESULT_HANDLED @@ -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,22 +192,22 @@ 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" +#define MPRIS_DBUS_ROOT_PATH "/" +#define MPRIS_DBUS_PLAYER_PATH "/Player" +#define MPRIS_DBUS_TRACKLIST_PATH "/TrackList" /* Handle messages reception */ DBUS_METHOD( handle_root );