]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_media_list_player.h
Use var_InheritString for --decklink-video-connection.
[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  * The LibVLC media list player plays a @ref libvlc_media_list_t list of media,
42  * in a certain order.
43  * This is required to especially support playlist files.
44  * The normal @ref libvlc_media_player_t LibVLC media player can only play a
45  * single media, and does not handle playlist files properly.
46  * @{
47  */
48
49 typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
50
51 /**
52  *  Defines playback modes for playlist.
53  */
54 typedef enum libvlc_playback_mode_t
55 {
56     libvlc_playback_mode_default,
57     libvlc_playback_mode_loop,
58     libvlc_playback_mode_repeat
59 } libvlc_playback_mode_t;
60
61 /**
62  * Create new media_list_player.
63  *
64  * \param p_instance libvlc instance
65  * \return media list player instance or NULL on error
66  */
67 VLC_PUBLIC_API libvlc_media_list_player_t *
68     libvlc_media_list_player_new( libvlc_instance_t * p_instance );
69
70 /**
71  * Release media_list_player.
72  *
73  * \param p_mlp media list player instance
74  */
75 VLC_PUBLIC_API void
76     libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
77
78 /**
79  * Return the event manager of this media_list_player.
80  *
81  * \param p_mlp media list player instance
82  * \return the event manager
83  */
84 VLC_PUBLIC_API libvlc_event_manager_t *
85     libvlc_media_list_player_event_manager(libvlc_media_list_player_t * p_mlp);
86
87 /**
88  * Replace media player in media_list_player with this instance.
89  *
90  * \param p_mlp media list player instance
91  * \param p_mi media player instance
92  */
93 VLC_PUBLIC_API void
94     libvlc_media_list_player_set_media_player(
95                                      libvlc_media_list_player_t * p_mlp,
96                                      libvlc_media_player_t * p_mi );
97
98 /**
99  * Set the media list associated with the player
100  *
101  * \param p_mlp media list player instance
102  * \param p_mlist list of media
103  */
104 VLC_PUBLIC_API void
105     libvlc_media_list_player_set_media_list(
106                                      libvlc_media_list_player_t * p_mlp,
107                                      libvlc_media_list_t * p_mlist );
108
109 /**
110  * Play media list
111  *
112  * \param p_mlp media list player instance
113  */
114 VLC_PUBLIC_API
115 void libvlc_media_list_player_play(libvlc_media_list_player_t * p_mlp);
116
117 /**
118  * Pause media list
119  *
120  * \param p_mlp media list player instance
121  */
122 VLC_PUBLIC_API
123 void libvlc_media_list_player_pause(libvlc_media_list_player_t * p_mlp);
124
125 /**
126  * Is media list playing?
127  *
128  * \param p_mlp media list player 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
134 /**
135  * Get current libvlc_state of media list player
136  *
137  * \param p_mlp media list player instance
138  * \return libvlc_state_t for media list player
139  */
140 VLC_PUBLIC_API libvlc_state_t
141     libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp );
142
143 /**
144  * Play media list item at position index
145  *
146  * \param p_mlp media list player instance
147  * \param i_index index in media list to play
148  * \return 0 upon success -1 if the item wasn't found
149  */
150 VLC_PUBLIC_API
151 int libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_t * p_mlp,
152                                                 int i_index);
153
154 /**
155  * Play the given media item
156  *
157  * \param p_mlp media list player instance
158  * \param p_md the media instance
159  * \return 0 upon success, -1 if the media is not part of the media list
160  */
161 VLC_PUBLIC_API
162 int libvlc_media_list_player_play_item(libvlc_media_list_player_t * p_mlp,
163                                        libvlc_media_t * p_md);
164
165 /**
166  * Stop playing media list
167  *
168  * \param p_mlp media list player instance
169  */
170 VLC_PUBLIC_API void
171     libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp);
172
173 /**
174  * Play next item from media list
175  *
176  * \param p_mlp media list player instance
177  * \return 0 upon success -1 if there is no next item
178  */
179 VLC_PUBLIC_API
180 int libvlc_media_list_player_next(libvlc_media_list_player_t * p_mlp);
181
182 /**
183  * Play previous item from media list
184  *
185  * \param p_mlp media list player instance
186  * \return 0 upon success -1 if there is no previous item
187  */
188 VLC_PUBLIC_API
189 int libvlc_media_list_player_previous(libvlc_media_list_player_t * p_mlp);
190
191
192
193 /**
194  * Sets the playback mode for the playlist
195  *
196  * \param p_mlp media list player instance
197  * \param e_mode playback mode specification
198  */
199 VLC_PUBLIC_API
200 void libvlc_media_list_player_set_playback_mode(libvlc_media_list_player_t * p_mlp,
201                                                 libvlc_playback_mode_t e_mode );
202
203 /** @} media_list_player */
204
205 # ifdef __cplusplus
206 }
207 # endif
208
209 #endif /* LIBVLC_MEDIA_LIST_PLAYER_H */