VLC  4.0.0-dev
libvlc_media_list_player.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * libvlc_media_list_player.h: libvlc_media_list API
3  *****************************************************************************
4  * Copyright (C) 1998-2008 VLC authors and VideoLAN
5  *
6  * Authors: Pierre d'Herbemont
7  *
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21  *****************************************************************************/
22 
23 #ifndef LIBVLC_MEDIA_LIST_PLAYER_H
24 #define LIBVLC_MEDIA_LIST_PLAYER_H 1
25 
26 # ifdef __cplusplus
27 extern "C" {
28 # endif
29 
30 /** \defgroup libvlc_media_list_player LibVLC media list player
31  * \ingroup libvlc
32  * The LibVLC media list player plays a @ref libvlc_media_list_t list of media,
33  * in a certain order.
34  * This is required to especially support playlist files.
35  * The normal @ref libvlc_media_player_t LibVLC media player can only play a
36  * single media, and does not handle playlist files properly.
37  * @{
38  * \file
39  * LibVLC media list player external API
40  */
41 
43 
44 /**
45  * Defines playback modes for playlist.
46  */
48 {
53 
54 /**
55  * Create new media_list_player.
56  *
57  * \param p_instance libvlc instance
58  * \return media list player instance or NULL on error
59  * (it must be released by libvlc_media_list_player_release())
60  */
63 
64 /**
65  * Release a media_list_player after use
66  * Decrement the reference count of a media player object. If the
67  * reference count is 0, then libvlc_media_list_player_release() will
68  * release the media player object. If the media player object
69  * has been released, then it should not be used again.
70  *
71  * \param p_mlp media list player instance
72  */
73 LIBVLC_API void
75 
76 /**
77  * Retain a reference to a media player list object. Use
78  * libvlc_media_list_player_release() to decrement reference count.
79  *
80  * \param p_mlp media player list object
81  */
82 LIBVLC_API void
84 
85 /**
86  * Return the event manager of this media_list_player.
87  *
88  * \param p_mlp media list player instance
89  * \return the event manager
90  */
93 
94 /**
95  * Replace media player in media_list_player with this instance.
96  *
97  * \param p_mlp media list player instance
98  * \param p_mi media player instance
99  */
100 LIBVLC_API void
103  libvlc_media_player_t * p_mi );
104 
105 /**
106  * Get media player of the media_list_player instance.
107  *
108  * \param p_mlp media list player instance
109  * \return media player instance
110  * \note the caller is responsible for releasing the returned instance
111  with libvlc_media_list_player_set_media_player().
112  */
115 
116 /**
117  * Set the media list associated with the player
118  *
119  * \param p_mlp media list player instance
120  * \param p_mlist list of media
121  */
122 LIBVLC_API void
125  libvlc_media_list_t * p_mlist );
126 
127 /**
128  * Play media list
129  *
130  * \param p_mlp media list player instance
131  */
134 
135 /**
136  * Toggle pause (or resume) media list
137  *
138  * \param p_mlp media list player instance
139  */
142 
143 /**
144  * Pause or resume media list
145  *
146  * \param p_mlp media list player instance
147  * \param do_pause play/resume if zero, pause if non-zero
148  * \version LibVLC 3.0.0 or later
149  */
152  int do_pause);
153 
154 /**
155  * Is media list playing?
156  *
157  * \param p_mlp media list player instance
158  *
159  * \retval true playing
160  * \retval false not playing
161  */
162 LIBVLC_API bool
164 
165 /**
166  * Get current libvlc_state of media list player
167  *
168  * \param p_mlp media list player instance
169  * \return libvlc_state_t for media list player
170  */
173 
174 /**
175  * Play media list item at position index
176  *
177  * \param p_mlp media list player instance
178  * \param i_index index in media list to play
179  * \return 0 upon success -1 if the item wasn't found
180  */
183  int i_index);
184 
185 /**
186  * Play the given media item
187  *
188  * \param p_mlp media list player instance
189  * \param p_md the media instance
190  * \return 0 upon success, -1 if the media is not part of the media list
191  */
194  libvlc_media_t * p_md);
195 
196 /**
197  * Stop playing media list
198  *
199  * \param p_mlp media list player instance
200  */
201 LIBVLC_API void
203 
204 /**
205  * Play next item from media list
206  *
207  * \param p_mlp media list player instance
208  * \return 0 upon success -1 if there is no next item
209  */
212 
213 /**
214  * Play previous item from media list
215  *
216  * \param p_mlp media list player instance
217  * \return 0 upon success -1 if there is no previous item
218  */
221 
222 
223 
224 /**
225  * Sets the playback mode for the playlist
226  *
227  * \param p_mlp media list player instance
228  * \param e_mode playback mode specification
229  */
232  libvlc_playback_mode_t e_mode );
233 
234 /** @} media_list_player */
235 
236 # ifdef __cplusplus
237 }
238 # endif
239 
240 #endif /* LIBVLC_MEDIA_LIST_PLAYER_H */
LIBVLC_API int libvlc_media_list_player_play_item(libvlc_media_list_player_t *p_mlp, libvlc_media_t *p_md)
Play the given media item.
LIBVLC_API void libvlc_media_list_player_release(libvlc_media_list_player_t *p_mlp)
Release a media_list_player after use Decrement the reference count of a media player object...
LIBVLC_API void libvlc_media_list_player_set_pause(libvlc_media_list_player_t *p_mlp, int do_pause)
Pause or resume media list.
libvlc_state_t
Note the order of libvlc_state_t enum must match exactly the order of.
Definition: libvlc_media.h:85
struct libvlc_media_list_player_t libvlc_media_list_player_t
Definition: libvlc_media_list_player.h:42
LIBVLC_API void libvlc_media_list_player_retain(libvlc_media_list_player_t *p_mlp)
Retain a reference to a media player list object.
struct libvlc_event_manager_t libvlc_event_manager_t
Event manager that belongs to a libvlc object, and from whom events can be received.
Definition: libvlc.h:304
LIBVLC_API int libvlc_media_list_player_next(libvlc_media_list_player_t *p_mlp)
Play next item from media list.
Definition: libvlc_media_list_player.h:51
LIBVLC_API libvlc_event_manager_t * libvlc_media_list_player_event_manager(libvlc_media_list_player_t *p_mlp)
Return the event manager of this media_list_player.
struct libvlc_media_t libvlc_media_t
Definition: libvlc_media.h:43
#define LIBVLC_API
Definition: libvlc.h:42
LIBVLC_API void libvlc_media_list_player_pause(libvlc_media_list_player_t *p_mlp)
Toggle pause (or resume) media list.
LIBVLC_API void libvlc_media_list_player_set_playback_mode(libvlc_media_list_player_t *p_mlp, libvlc_playback_mode_t e_mode)
Sets the playback mode for the playlist.
LIBVLC_API void libvlc_media_list_player_stop_async(libvlc_media_list_player_t *p_mlp)
Stop playing media list.
libvlc_playback_mode_t
Defines playback modes for playlist.
Definition: libvlc_media_list_player.h:47
LIBVLC_API libvlc_media_player_t * libvlc_media_list_player_get_media_player(libvlc_media_list_player_t *p_mlp)
Get media player of the media_list_player instance.
LIBVLC_API int libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_t *p_mlp, int i_index)
Play media list item at position index.
LIBVLC_API int libvlc_media_list_player_previous(libvlc_media_list_player_t *p_mlp)
Play previous item from media list.
LIBVLC_API bool libvlc_media_list_player_is_playing(libvlc_media_list_player_t *p_mlp)
Is media list playing?
LIBVLC_API void libvlc_media_list_player_play(libvlc_media_list_player_t *p_mlp)
Play media list.
Definition: libvlc_media_list_player.h:49
LIBVLC_API libvlc_state_t libvlc_media_list_player_get_state(libvlc_media_list_player_t *p_mlp)
Get current libvlc_state of media list player.
struct libvlc_instance_t libvlc_instance_t
This structure is opaque.
Definition: libvlc.h:76
struct libvlc_media_list_t libvlc_media_list_t
Definition: libvlc_media_list.h:38
LIBVLC_API libvlc_media_list_player_t * libvlc_media_list_player_new(libvlc_instance_t *p_instance)
Create new media_list_player.
LIBVLC_API void libvlc_media_list_player_set_media_list(libvlc_media_list_player_t *p_mlp, libvlc_media_list_t *p_mlist)
Set the media list associated with the player.
struct libvlc_media_player_t libvlc_media_player_t
Definition: libvlc_media_player.h:42
Definition: libvlc_media_list_player.h:50
LIBVLC_API void libvlc_media_list_player_set_media_player(libvlc_media_list_player_t *p_mlp, libvlc_media_player_t *p_mi)
Replace media player in media_list_player with this instance.