VLC 4.0.0-dev
Loading...
Searching...
No Matches
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#include <vlc/libvlc.h>
27#include <vlc/libvlc_media.h>
28
29# ifdef __cplusplus
30extern "C" {
31# endif
32
37
38/** \defgroup libvlc_media_list_player LibVLC media list player
39 * \ingroup libvlc
40 * The LibVLC media list player plays a @ref libvlc_media_list_t list of media,
41 * in a certain order.
42 * This is required to especially support playlist files.
43 * The normal @ref libvlc_media_player_t LibVLC media player can only play a
44 * single media, and does not handle playlist files properly.
45 * @{
46 * \file
47 * LibVLC media list player external API
48 */
49
51
52/**
53 * Defines playback modes for playlist.
54 */
61
62/**
63 * Create new media_list_player.
64 *
65 * \param p_instance libvlc instance
66 * \return media list player instance or NULL on error
67 * (it must be released by libvlc_media_list_player_release())
68 */
71
72/**
73 * Release a media_list_player after use
74 * Decrement the reference count of a media player object. If the
75 * reference count is 0, then libvlc_media_list_player_release() will
76 * release the media player object. If the media player object
77 * has been released, then it should not be used again.
78 *
79 * \param p_mlp media list player instance
80 */
81LIBVLC_API void
83
84/**
85 * Retain a reference to a media player list object. Use
86 * libvlc_media_list_player_release() to decrement reference count.
87 *
88 * \param p_mlp media player list object
89 * \return the same object
90 */
93
94/**
95 * Return the event manager of this media_list_player.
96 *
97 * \param p_mlp media list player instance
98 * \return the event manager
99 */
102
103/**
104 * Replace media player in media_list_player with this instance.
105 *
106 * \param p_mlp media list player instance
107 * \param p_mi media player instance
108 */
109LIBVLC_API void
112 libvlc_media_player_t * p_mi );
113
114/**
115 * Get media player of the media_list_player instance.
116 *
117 * \param p_mlp media list player instance
118 * \return media player instance
119 * \note the caller is responsible for releasing the returned instance
120 with libvlc_media_list_player_set_media_player().
121 */
124
125/**
126 * Set the media list associated with the player
127 *
128 * \param p_mlp media list player instance
129 * \param p_mlist list of media
130 */
131LIBVLC_API void
134 libvlc_media_list_t * p_mlist );
135
136/**
137 * Play media list
138 *
139 * \param p_mlp media list player instance
140 */
143
144/**
145 * Toggle pause (or resume) media list
146 *
147 * \param p_mlp media list player instance
148 */
151
152/**
153 * Pause or resume media list
154 *
155 * \param p_mlp media list player instance
156 * \param do_pause play/resume if zero, pause if non-zero
157 * \version LibVLC 3.0.0 or later
158 */
161 int do_pause);
162
163/**
164 * Is media list playing?
165 *
166 * \param p_mlp media list player instance
167 *
168 * \retval true playing
169 * \retval false not playing
170 */
171LIBVLC_API bool
173
174/**
175 * Get current libvlc_state of media list player
176 *
177 * \param p_mlp media list player instance
178 * \return libvlc_state_t for media list player
179 */
182
183/**
184 * Play media list item at position index
185 *
186 * \param p_mlp media list player instance
187 * \param i_index index in media list to play
188 * \return 0 upon success -1 if the item wasn't found
189 */
192 int i_index);
193
194/**
195 * Play the given media item
196 *
197 * \param p_mlp media list player instance
198 * \param p_md the media instance
199 * \return 0 upon success, -1 if the media is not part of the media list
200 */
203 libvlc_media_t * p_md);
204
205/**
206 * Stop playing media list
207 *
208 * \param p_mlp media list player instance
209 */
210LIBVLC_API void
212
213/**
214 * Play next item from media list
215 *
216 * \param p_mlp media list player instance
217 * \return 0 upon success -1 if there is no next item
218 */
221
222/**
223 * Play previous item from media list
224 *
225 * \param p_mlp media list player instance
226 * \return 0 upon success -1 if there is no previous item
227 */
230
231
232
233/**
234 * Sets the playback mode for the playlist
235 *
236 * \param p_mlp media list player instance
237 * \param e_mode playback mode specification
238 */
241 libvlc_playback_mode_t e_mode );
242
243/** @} media_list_player */
244
245# ifdef __cplusplus
246}
247# endif
248
249#endif /* LIBVLC_MEDIA_LIST_PLAYER_H */
struct libvlc_instance_t libvlc_instance_t
This structure is opaque.
Definition libvlc.h:76
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:283
libvlc_media_list_player_t * libvlc_media_list_player_retain(libvlc_media_list_player_t *p_mlp)
Retain a reference to a media player list object.
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.
void libvlc_media_list_player_play(libvlc_media_list_player_t *p_mlp)
Play media list.
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.
void libvlc_media_list_player_pause(libvlc_media_list_player_t *p_mlp)
Toggle pause (or resume) media list.
libvlc_playback_mode_t
Defines playback modes for playlist.
Definition libvlc_media_list_player.h:56
int libvlc_media_list_player_previous(libvlc_media_list_player_t *p_mlp)
Play previous item from media list.
struct libvlc_media_list_player_t libvlc_media_list_player_t
Definition libvlc_media_list_player.h:50
int libvlc_media_list_player_play_item(libvlc_media_list_player_t *p_mlp, libvlc_media_t *p_md)
Play the given media item.
int libvlc_media_list_player_next(libvlc_media_list_player_t *p_mlp)
Play next item from media list.
libvlc_state_t libvlc_media_list_player_get_state(libvlc_media_list_player_t *p_mlp)
Get current libvlc_state of media list player.
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_media_list_player_t * libvlc_media_list_player_new(libvlc_instance_t *p_instance)
Create new media_list_player.
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_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.
void libvlc_media_list_player_stop_async(libvlc_media_list_player_t *p_mlp)
Stop playing media list.
bool libvlc_media_list_player_is_playing(libvlc_media_list_player_t *p_mlp)
Is media list playing?
void libvlc_media_list_player_set_pause(libvlc_media_list_player_t *p_mlp, int do_pause)
Pause or resume media list.
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.
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.
@ libvlc_playback_mode_repeat
Definition libvlc_media_list_player.h:59
@ libvlc_playback_mode_loop
Definition libvlc_media_list_player.h:58
@ libvlc_playback_mode_default
Definition libvlc_media_list_player.h:57
libvlc_state_t
libvlc media or media_player state
Definition libvlc_media.h:84
#define LIBVLC_API
Definition libvlc.h:42
LibVLC core external API.
struct libvlc_media_list_t libvlc_media_list_t
Definition libvlc_events.h:48
struct libvlc_media_t libvlc_media_t
Definition libvlc_events.h:47
LibVLC media item/descriptor external API.
struct libvlc_media_player_t libvlc_media_player_t
Definition libvlc_media_list_player.h:34