56c0de33b5ffe05828194a2297dc671386ed797d
[vlc.git] / modules / control / dbus / dbus_player.h
1 /*****************************************************************************
2  * dbus_player.h : dbus control module (mpris v2.2) - Player object
3  *****************************************************************************
4  * Copyright © 2006-2008 Rafaël Carré
5  * Copyright © 2007-2010 Mirsal Ennaime
6  * Copyright © 2009-2010 The VideoLAN team
7  * $Id$
8  *
9  * Authors:    Mirsal Ennaime <mirsal at mirsal fr>
10  *             Rafaël Carré <funman at videolanorg>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25  *****************************************************************************/
26
27 #ifndef _VLC_DBUS_PLAYER_H
28 #define _VLC_DBUS_PLAYER_H
29
30 #include <vlc_interface.h>
31 #include "dbus_common.h"
32
33 #define DBUS_MPRIS_PLAYER_INTERFACE    "org.mpris.MediaPlayer2.Player"
34
35 #define LOOP_STATUS_NONE  "None"
36 #define LOOP_STATUS_TRACK "Track"
37 #define LOOP_STATUS_PLAYLIST "Playlist"
38
39 #define PLAYBACK_STATUS_STOPPED "Stopped"
40 #define PLAYBACK_STATUS_PLAYING "Playing"
41 #define PLAYBACK_STATUS_PAUSED  "Paused"
42
43 /* Handle incoming dbus messages */
44 DBusHandlerResult handle_player ( DBusConnection *p_conn,
45                                   DBusMessage *p_from,
46                                   void *p_this );
47
48 /* Player capabilities */
49 enum
50 {
51      PLAYER_CAPS_NONE            = 0,
52      PLAYER_CAN_GO_NEXT          = 1 << 0,
53      PLAYER_CAN_GO_PREVIOUS      = 1 << 1,
54      PLAYER_CAN_PAUSE            = 1 << 2,
55      PLAYER_CAN_PLAY             = 1 << 3,
56      PLAYER_CAN_SEEK             = 1 << 4,
57      PLAYER_CAN_PROVIDE_METADATA = 1 << 5,
58      PLAYER_CAN_PROVIDE_POSITION = 1 << 6,
59      PLAYER_CAN_REPEAT           = 1 << 7,
60      PLAYER_CAN_LOOP             = 1 << 8,
61      PLAYER_CAN_SHUFFLE          = 1 << 9,
62      PLAYER_CAN_CONTROL_RATE     = 1 << 10,
63      PLAYER_CAN_PLAY_BACKWARDS   = 1 << 11
64 };
65
66 int PlayerStatusChangedEmit     ( intf_thread_t * );
67 int PlayerCapsChangedEmit ( intf_thread_t * );
68 int PlayerMetadataChangedEmit( intf_thread_t*, input_item_t* );
69 int TrackChangedEmit      ( intf_thread_t *, input_item_t * );
70 int SeekedEmit( intf_thread_t * );
71
72 int PlayerPropertiesChangedEmit( intf_thread_t *, vlc_dictionary_t * );
73
74 void UpdatePlayerCaps( intf_thread_t * );
75
76 #endif //dbus_player.h