Changeset 460774aa07c637f6ef7af1cfe2371d759c2bc5ab

Show
Ignore:
Timestamp:
03/06/07 02:46:03 (2 years ago)
Author:
Jean-Baptiste Kempf <jb@videolan.org>
git-committer:
Jean-Baptiste Kempf <jb@videolan.org> 1180831563 +0000
git-parent:

[9fcf0621638218217fc6c3400b29e5094488ee32]

git-author:
Jean-Baptiste Kempf <jb@videolan.org> 1180831563 +0000
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • NEWS

    r99a8123 r460774a  
    8484 * Unix 
    8585   * Allow only one running instance, using D-Bus interface (experimental). 
     86   * D-Bus Interface (experimental) implements the MPRIS  
     87     (Media Player Remote Interfacing specification), a common dbus control  
     88     interface for media players that intends to become an xdg standard when  
     89     finished. 
    8690 
    8791Capture: 
  • modules/control/dbus.c

    r211b483 r460774a  
    574574} 
    575575 
     576DBUS_METHOD( Random ) 
     577{ 
     578    REPLY_INIT; 
     579    OUT_ARGUMENTS; 
     580 
     581    DBusError error; 
     582    dbus_bool_t b_random; 
     583    vlc_value_t val; 
     584    playlist_t* p_playlist = NULL; 
     585     
     586    dbus_error_init( &error ); 
     587    dbus_message_get_args( p_from, &error, 
     588            DBUS_TYPE_BOOLEAN, &b_random, 
     589            DBUS_TYPE_INVALID ); 
     590     
     591    if( dbus_error_is_set( &error ) ) 
     592    { 
     593        msg_Err( (vlc_object_t*) p_this, "D-Bus message reading : %s\n", 
     594                error.message ); 
     595        dbus_error_free( &error ); 
     596        return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; 
     597    } 
     598 
     599    val.b_bool = ( b_random == TRUE ) ? VLC_TRUE : VLC_FALSE ; 
     600     
     601    p_playlist = pl_Yield( (vlc_object_t*) p_this ); 
     602    var_Set ( p_playlist, "random", val ); 
     603    pl_Release( ((vlc_object_t*) p_this) ); 
     604 
     605    REPLY_SEND; 
     606} 
    576607/***************************************************************************** 
    577608 * Introspection method 
     
    664695    METHOD_FUNC( "Loop",                    Loop ); 
    665696    METHOD_FUNC( "Repeat",                  Repeat ); 
     697    METHOD_FUNC( "Random",                  Random ); 
    666698 
    667699    return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; 
  • modules/control/dbus.h

    r211b483 r460774a  
    180180"      <arg type=\"b\" direction=\"in\" />\n" 
    181181"    </method>\n" 
     182"    <method name=\"Random\">\n" 
     183"      <arg type=\"b\" direction=\"in\" />\n" 
     184"    </method>\n" 
    182185"  </interface>\n" 
    183186"</node>\n"