Commit d4c5140c authored by Rafaël Carré's avatar Rafaël Carré

dbus fixes

really route messages to tracklist interface
fix DBUS_MPRIS_TRACKLIST_INTERFACE definition
fix CanQuit/CanRaise/HasTracklist input types

fix AddTrack function
The function has changed in mpris 2.1, but the additional parameter isn't being used by VLC (yet)
parent 12f9e10c
...@@ -818,6 +818,9 @@ MPRISEntryPoint ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this ) ...@@ -818,6 +818,9 @@ MPRISEntryPoint ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this )
if( !strcmp( psz_target_interface, DBUS_MPRIS_PLAYER_INTERFACE ) ) if( !strcmp( psz_target_interface, DBUS_MPRIS_PLAYER_INTERFACE ) )
return handle_player( p_conn, p_from, p_this ); return handle_player( p_conn, p_from, p_this );
if( !strcmp( psz_target_interface, DBUS_MPRIS_TRACKLIST_INTERFACE ) )
return handle_tracklist( p_conn, p_from, p_this );
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
} }
......
...@@ -64,7 +64,7 @@ DBUS_METHOD( CanQuit ) ...@@ -64,7 +64,7 @@ DBUS_METHOD( CanQuit )
const dbus_bool_t b_ret = TRUE; const dbus_bool_t b_ret = TRUE;
DBusMessageIter v; DBusMessageIter v;
dbus_message_iter_open_container( &args, DBUS_TYPE_VARIANT, "s", &v ); dbus_message_iter_open_container( &args, DBUS_TYPE_VARIANT, "b", &v );
dbus_message_iter_append_basic( &v, DBUS_TYPE_BOOLEAN, &b_ret ); dbus_message_iter_append_basic( &v, DBUS_TYPE_BOOLEAN, &b_ret );
if( !dbus_message_iter_close_container( &args, &v ) ) if( !dbus_message_iter_close_container( &args, &v ) )
...@@ -82,7 +82,7 @@ DBUS_METHOD( CanRaise ) ...@@ -82,7 +82,7 @@ DBUS_METHOD( CanRaise )
const dbus_bool_t b_ret = FALSE; const dbus_bool_t b_ret = FALSE;
DBusMessageIter v; DBusMessageIter v;
dbus_message_iter_open_container( &args, DBUS_TYPE_VARIANT, "s", &v ); dbus_message_iter_open_container( &args, DBUS_TYPE_VARIANT, "b", &v );
dbus_message_iter_append_basic( &v, DBUS_TYPE_BOOLEAN, &b_ret ); dbus_message_iter_append_basic( &v, DBUS_TYPE_BOOLEAN, &b_ret );
if( !dbus_message_iter_close_container( &args, &v ) ) if( !dbus_message_iter_close_container( &args, &v ) )
...@@ -100,7 +100,7 @@ DBUS_METHOD( HasTrackList ) ...@@ -100,7 +100,7 @@ DBUS_METHOD( HasTrackList )
const dbus_bool_t b_ret = FALSE; const dbus_bool_t b_ret = FALSE;
DBusMessageIter v; DBusMessageIter v;
dbus_message_iter_open_container( &args, DBUS_TYPE_VARIANT, "s", &v ); dbus_message_iter_open_container( &args, DBUS_TYPE_VARIANT, "b", &v );
dbus_message_iter_append_basic( &v, DBUS_TYPE_BOOLEAN, &b_ret ); dbus_message_iter_append_basic( &v, DBUS_TYPE_BOOLEAN, &b_ret );
if( !dbus_message_iter_close_container( &args, &v ) ) if( !dbus_message_iter_close_container( &args, &v ) )
......
...@@ -39,16 +39,16 @@ ...@@ -39,16 +39,16 @@
DBUS_METHOD( AddTrack ) DBUS_METHOD( AddTrack )
{ /* add the string to the playlist, and play it if the boolean is true */ { /* add the string to the playlist, and play it if the boolean is true */
REPLY_INIT; REPLY_INIT;
OUT_ARGUMENTS;
DBusError error; DBusError error;
dbus_error_init( &error ); dbus_error_init( &error );
char *psz_mrl; char *psz_mrl, *psz_aftertrack;
dbus_bool_t b_play; dbus_bool_t b_play;
dbus_message_get_args( p_from, &error, dbus_message_get_args( p_from, &error,
DBUS_TYPE_STRING, &psz_mrl, DBUS_TYPE_STRING, &psz_mrl,
DBUS_TYPE_OBJECT_PATH, &psz_aftertrack,
DBUS_TYPE_BOOLEAN, &b_play, DBUS_TYPE_BOOLEAN, &b_play,
DBUS_TYPE_INVALID ); DBUS_TYPE_INVALID );
...@@ -60,13 +60,11 @@ DBUS_METHOD( AddTrack ) ...@@ -60,13 +60,11 @@ DBUS_METHOD( AddTrack )
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
} }
#warning psz_aftertrack is not used
playlist_Add( PL, psz_mrl, NULL, PLAYLIST_APPEND | playlist_Add( PL, psz_mrl, NULL, PLAYLIST_APPEND |
( ( b_play == TRUE ) ? PLAYLIST_GO : 0 ) , ( ( b_play == TRUE ) ? PLAYLIST_GO : 0 ) ,
PLAYLIST_END, true, false ); PLAYLIST_END, true, false );
dbus_int32_t i_success = 0;
ADD_INT32( &i_success );
REPLY_SEND; REPLY_SEND;
} }
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#include <vlc_interface.h> #include <vlc_interface.h>
#include "dbus_common.h" #include "dbus_common.h"
#define DBUS_MPRIS_TRACKLIST_INTERFACE "org.mpris.MediaPlayer.TrackList" #define DBUS_MPRIS_TRACKLIST_INTERFACE "org.mpris.MediaPlayer2.TrackList"
#define DBUS_MPRIS_TRACKLIST_PATH "/org/mpris/MediaPlayer/TrackList" #define DBUS_MPRIS_TRACKLIST_PATH "/org/mpris/MediaPlayer2/TrackList"
/* Handle incoming dbus messages */ /* Handle incoming dbus messages */
DBusHandlerResult handle_tracklist ( DBusConnection *p_conn, DBusHandlerResult handle_tracklist ( DBusConnection *p_conn,
......
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