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>
28
29# ifdef __cplusplus
30extern "C" {
31# endif
32
36typedef struct libvlc_media_t libvlc_media_t;
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 * \param cbs callback to listen to events (can be NULL). The pointed
67 * struct must be kept alive (and not modified) by the caller until
68 * the returned media list player is released.
69 * \param cbs_opaque opaque pointer used by the callbacks
70 * \return media list player instance or NULL on error
71 * (it must be released by libvlc_media_list_player_release())
72 */
75 const struct libvlc_media_player_cbs *cbs,
76 void *cbs_opaque );
77
78/**
79 * Release a media_list_player after use
80 * Decrement the reference count of a media list player object. If the
81 * reference count is 0, then libvlc_media_list_player_release() will
82 * release the media list player object. If the media list player object
83 * has been released, then it should not be used again.
84 *
85 * \param p_mlp media list player instance
86 */
87LIBVLC_API void
89
90/**
91 * Retain a reference to a media player list object. Use
92 * libvlc_media_list_player_release() to decrement reference count.
93 *
94 * \param p_mlp media player list object
95 * \return the same object
96 */
99
100/**
101 * Get media player of the media_list_player instance.
102 *
103 * \param p_mlp media list player instance
104 * \return media player instance
105 * \note the caller is responsible for releasing the returned instance
106 * with libvlc_media_player_release().
107 */
110
111/**
112 * Set the media list associated with the player
113 *
114 * \param p_mlp media list player instance
115 * \param p_mlist list of media
116 */
117LIBVLC_API void
120 libvlc_media_list_t * p_mlist );
121
122/**
123 * Play media list
124 *
125 * \param p_mlp media list player instance
126 */
129
130/**
131 * Toggle pause (or resume) media list
132 *
133 * \param p_mlp media list player instance
134 */
137
138/**
139 * Pause or resume media list
140 *
141 * \param p_mlp media list player instance
142 * \param do_pause play/resume if zero, pause if non-zero
143 * \version LibVLC 3.0.0 or later
144 */
147 int do_pause);
148
149/**
150 * Is media list playing?
151 *
152 * \param p_mlp media list player instance
153 *
154 * \retval true playing
155 * \retval false not playing
156 */
157LIBVLC_API bool
159
160/**
161 * Get current libvlc_state of media list player
162 *
163 * \param p_mlp media list player instance
164 * \return libvlc_state_t for media list player
165 */
168
169/**
170 * Play media list item at position index
171 *
172 * \param p_mlp media list player instance
173 * \param i_index index in media list to play
174 * \return 0 upon success -1 if the item wasn't found
175 */
178 int i_index);
179
180/**
181 * Play the given media item
182 *
183 * \param p_mlp media list player instance
184 * \param p_md the media instance
185 * \return 0 upon success, -1 if the media is not part of the media list
186 */
189 libvlc_media_t * p_md);
190
191/**
192 * Stop playing media list
193 *
194 * \param p_mlp media list player instance
195 */
196LIBVLC_API void
198
199/**
200 * Play next item from media list
201 *
202 * \param p_mlp media list player instance
203 * \return 0 upon success -1 if there is no next item
204 */
207
208/**
209 * Play previous item from media list
210 *
211 * \param p_mlp media list player instance
212 * \return 0 upon success -1 if there is no previous item
213 */
216
217
218
219/**
220 * Sets the playback mode for the playlist
221 *
222 * \param p_mlp media list player instance
223 * \param e_mode playback mode specification
224 */
227 libvlc_playback_mode_t e_mode );
228
229/** @} media_list_player */
230
231# ifdef __cplusplus
232}
233# endif
234
235#endif /* LIBVLC_MEDIA_LIST_PLAYER_H */
struct libvlc_instance_t libvlc_instance_t
This structure is opaque.
Definition libvlc.h:76
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_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.
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 list player object.
libvlc_media_list_player_t * libvlc_media_list_player_new(libvlc_instance_t *p_instance, const struct libvlc_media_player_cbs *cbs, void *cbs_opaque)
Create new media_list_player.
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_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
struct libvlc_media_list_t libvlc_media_list_t
Definition libvlc_media_list.h:40
struct libvlc_media_player_t libvlc_media_player_t
Definition libvlc_media_list_player.h:34
libvlc_state_t
libvlc media or media_player state
Definition libvlc_media.h:84
struct libvlc_media_t libvlc_media_t
Definition libvlc_media.h:47
#define LIBVLC_API
Definition libvlc.h:42
LibVLC core external API.
LibVLC simple media player external API.
struct defining callbacks for libvlc_media_player_new()
Definition libvlc_media_player.h:231