Commit 460774aa authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

D-Bus - Implement "Random" Method. Patch from Mirsal ENNAIME, as usual.

parent 9fcf0621
...@@ -83,6 +83,10 @@ Interfaces: ...@@ -83,6 +83,10 @@ Interfaces:
* Improved mouse gestures * Improved mouse gestures
* Unix * Unix
* Allow only one running instance, using D-Bus interface (experimental). * Allow only one running instance, using D-Bus interface (experimental).
* D-Bus Interface (experimental) implements the MPRIS
(Media Player Remote Interfacing specification), a common dbus control
interface for media players that intends to become an xdg standard when
finished.
Capture: Capture:
* new BDA device driver plugin for DVB-C/S/T capture cards on Microsoft * new BDA device driver plugin for DVB-C/S/T capture cards on Microsoft
......
...@@ -573,6 +573,37 @@ DBUS_METHOD( Repeat ) ...@@ -573,6 +573,37 @@ DBUS_METHOD( Repeat )
REPLY_SEND; REPLY_SEND;
} }
DBUS_METHOD( Random )
{
REPLY_INIT;
OUT_ARGUMENTS;
DBusError error;
dbus_bool_t b_random;
vlc_value_t val;
playlist_t* p_playlist = NULL;
dbus_error_init( &error );
dbus_message_get_args( p_from, &error,
DBUS_TYPE_BOOLEAN, &b_random,
DBUS_TYPE_INVALID );
if( dbus_error_is_set( &error ) )
{
msg_Err( (vlc_object_t*) p_this, "D-Bus message reading : %s\n",
error.message );
dbus_error_free( &error );
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
val.b_bool = ( b_random == TRUE ) ? VLC_TRUE : VLC_FALSE ;
p_playlist = pl_Yield( (vlc_object_t*) p_this );
var_Set ( p_playlist, "random", val );
pl_Release( ((vlc_object_t*) p_this) );
REPLY_SEND;
}
/***************************************************************************** /*****************************************************************************
* Introspection method * Introspection method
*****************************************************************************/ *****************************************************************************/
...@@ -663,6 +694,7 @@ DBUS_METHOD( handle_tracklist ) ...@@ -663,6 +694,7 @@ DBUS_METHOD( handle_tracklist )
METHOD_FUNC( "DelTrack", DelTrack ); METHOD_FUNC( "DelTrack", DelTrack );
METHOD_FUNC( "Loop", Loop ); METHOD_FUNC( "Loop", Loop );
METHOD_FUNC( "Repeat", Repeat ); METHOD_FUNC( "Repeat", Repeat );
METHOD_FUNC( "Random", Random );
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
} }
......
...@@ -179,6 +179,9 @@ const char* psz_introspection_xml_data_tracklist = ...@@ -179,6 +179,9 @@ const char* psz_introspection_xml_data_tracklist =
" <method name=\"Repeat\">\n" " <method name=\"Repeat\">\n"
" <arg type=\"b\" direction=\"in\" />\n" " <arg type=\"b\" direction=\"in\" />\n"
" </method>\n" " </method>\n"
" <method name=\"Random\">\n"
" <arg type=\"b\" direction=\"in\" />\n"
" </method>\n"
" </interface>\n" " </interface>\n"
"</node>\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