Changeset 460774aa07c637f6ef7af1cfe2371d759c2bc5ab
- 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
| r99a8123 |
r460774a |
|
| 84 | 84 | * Unix |
|---|
| 85 | 85 | * 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. |
|---|
| 86 | 90 | |
|---|
| 87 | 91 | Capture: |
|---|
| r211b483 |
r460774a |
|
| 574 | 574 | } |
|---|
| 575 | 575 | |
|---|
| | 576 | DBUS_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 | } |
|---|
| 576 | 607 | /***************************************************************************** |
|---|
| 577 | 608 | * Introspection method |
|---|
| … | … | |
| 664 | 695 | METHOD_FUNC( "Loop", Loop ); |
|---|
| 665 | 696 | METHOD_FUNC( "Repeat", Repeat ); |
|---|
| | 697 | METHOD_FUNC( "Random", Random ); |
|---|
| 666 | 698 | |
|---|
| 667 | 699 | return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; |
|---|
| r211b483 |
r460774a |
|
| 180 | 180 | " <arg type=\"b\" direction=\"in\" />\n" |
|---|
| 181 | 181 | " </method>\n" |
|---|
| | 182 | " <method name=\"Random\">\n" |
|---|
| | 183 | " <arg type=\"b\" direction=\"in\" />\n" |
|---|
| | 184 | " </method>\n" |
|---|
| 182 | 185 | " </interface>\n" |
|---|
| 183 | 186 | "</node>\n" |
|---|