]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_media_list_player.h
libvlc_events: use int instead of uint64_t (using booleans here might be dangerous...
[vlc] / include / vlc / libvlc_media_list_player.h
1 /*****************************************************************************
2  * libvlc_media_list.h:  libvlc_media_list API
3  *****************************************************************************
4  * Copyright (C) 1998-2008 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Pierre d'Herbemont
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef LIBVLC_MEDIA_LIST_PLAYER_H
25 #define LIBVLC_MEDIA_LIST_PLAYER_H 1
26
27 /**
28  * \file
29  * This file defines libvlc_media_list_player API
30  */
31
32 # ifdef __cplusplus
33 extern "C" {
34 # endif
35
36 /*****************************************************************************
37  * Media List Player
38  *****************************************************************************/
39 /** \defgroup libvlc_media_list_player libvlc_media_list_player
40  * \ingroup libvlc
41  * LibVLC Media List Player, play a media_list. You can see that as a media
42  * instance subclass
43  * @{
44  */
45
46 typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
47
48 /**
49  *  Defines playback modes for playlist.
50  */
51 typedef enum libvlc_playback_mode_t
52 {
53     libvlc_playback_mode_default,
54     libvlc_playback_mode_loop,
55     libvlc_playback_mode_repeat
56 } libvlc_playback_mode_t;
57
58 /**
59  * Create new media_list_player.
60  *
61  * \param p_instance libvlc instance
62  * \param p_e initialized exception instance
63  * \return media list player instance
64  */
65 VLC_PUBLIC_API libvlc_media_list_player_t *
66     libvlc_media_list_player_new( libvlc_instance_t * p_instance,
67                                   libvlc_exception_t * p_e );
68
69 /**
70  * Release media_list_player.
71  *
72  * \param p_mlp media list player instance
73  */
74 VLC_PUBLIC_API void
75     libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
76
77 /**
78  * Return the event manager of this media_list_player.
79  *
80  * \param p_mlp media list player instance
81  */
82 VLC_PUBLIC_API libvlc_event_manager_t *
83     libvlc_media_list_player_event_manager(libvlc_media_list_player_t * p_mlp);
84
85 /**
86  * Replace media player in media_list_player with this instance.
87  *
88  * \param p_mlp media list player instance
89  * \param p_mi media player instance
90  * \param p_e initialized exception instance
91  */
92 VLC_PUBLIC_API void
93     libvlc_media_list_player_set_media_player(
94                                      libvlc_media_list_player_t * p_mlp,
95                                      libvlc_media_player_t * p_mi,
96                                      libvlc_exception_t * p_e );
97
98 VLC_PUBLIC_API void
99     libvlc_media_list_player_set_media_list(
100                                      libvlc_media_list_player_t * p_mlp,
101                                      libvlc_media_list_t * p_mlist,
102                                      libvlc_exception_t * p_e );
103
104 /**
105  * Play media list
106  *
107  * \param p_mlp media list player instance
108  * \param p_e initialized exception instance
109  */
110 VLC_PUBLIC_API void
111     libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
112                                    libvlc_exception_t * p_e );
113
114 /**
115  * Pause media list
116  *
117  * \param p_mlp media list player instance
118  * \param p_e initialized exception instance
119  */
120 VLC_PUBLIC_API void
121     libvlc_media_list_player_pause( libvlc_media_list_player_t * p_mlp,
122                                    libvlc_exception_t * p_e );
123
124 /**
125  * Is media list playing?
126  *
127  * \param p_mlp media list player instance
128  * \param p_e initialized exception instance
129  * \return true for playing and false for not playing
130  */
131 VLC_PUBLIC_API int
132     libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
133                                          libvlc_exception_t * p_e );
134
135 /**
136  * Get current libvlc_state of media list player
137  *
138  * \param p_mlp media list player instance
139  * \param p_e initialized exception instance
140  * \return libvlc_state_t for media list player
141  */
142 VLC_PUBLIC_API libvlc_state_t
143     libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp,
144                                         libvlc_exception_t * p_e );
145
146 /**
147  * Play media list item at position index
148  *
149  * \param p_mlp media list player instance
150  * \param i_index index in media list to play
151  * \param p_e initialized exception instance
152  */
153 VLC_PUBLIC_API void
154     libvlc_media_list_player_play_item_at_index(
155                                    libvlc_media_list_player_t * p_mlp,
156                                    int i_index,
157                                    libvlc_exception_t * p_e );
158
159 VLC_PUBLIC_API void
160     libvlc_media_list_player_play_item(
161                                    libvlc_media_list_player_t * p_mlp,
162                                    libvlc_media_t * p_md,
163                                    libvlc_exception_t * p_e );
164
165 /**
166  * Stop playing media list
167  *
168  * \param p_mlp media list player instance
169  * \param p_e initialized exception instance
170  */
171 VLC_PUBLIC_API void
172     libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
173                                    libvlc_exception_t * p_e );
174
175 /**
176  * Play next item from media list
177  *
178  * \param p_mlp media list player instance
179  * \param p_e initialized exception instance
180  */
181 VLC_PUBLIC_API void
182     libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
183                                    libvlc_exception_t * p_e );
184
185 /**
186  * Play previous item from media list
187  *
188  * \param p_mlp media list player instance
189  * \param p_e initialized exception instance
190  */
191 VLC_PUBLIC_API void
192     libvlc_media_list_player_previous( libvlc_media_list_player_t * p_mlp,
193                                        libvlc_exception_t * p_e );
194
195
196
197 /**
198  * Sets the playback mode for the playlist
199  *
200  * \param p_mlp media list player instance
201  * \param e_mode playback mode specification
202  * \param p_e initialized exception instance
203  */
204 VLC_PUBLIC_API void
205     libvlc_media_list_player_set_playback_mode( 
206                                         libvlc_media_list_player_t * p_mlp,
207                                         libvlc_playback_mode_t e_mode,
208                                         libvlc_exception_t * p_e );
209
210 /** @} media_list_player */
211
212 # ifdef __cplusplus
213 }
214 # endif
215
216 #endif /* LIBVLC_MEDIA_LIST_PLAYER_H */