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_player.h
>
28
29
# ifdef __cplusplus
30
extern
"C"
{
31
# endif
32
33
typedef
struct
libvlc_instance_t
libvlc_instance_t
;
34
typedef
struct
libvlc_media_player_t
libvlc_media_player_t
;
35
typedef
struct
libvlc_media_list_t
libvlc_media_list_t
;
36
typedef
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
50
typedef
struct
libvlc_media_list_player_t
libvlc_media_list_player_t
;
51
52
/**
53
* Defines playback modes for playlist.
54
*/
55
typedef
enum
libvlc_playback_mode_t
56
{
57
libvlc_playback_mode_default
,
58
libvlc_playback_mode_loop
,
59
libvlc_playback_mode_repeat
60
}
libvlc_playback_mode_t
;
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
*/
73
LIBVLC_API
libvlc_media_list_player_t
*
74
libvlc_media_list_player_new
(
libvlc_instance_t
* p_instance,
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
*/
87
LIBVLC_API
void
88
libvlc_media_list_player_release
(
libvlc_media_list_player_t
* p_mlp );
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
*/
97
LIBVLC_API
libvlc_media_list_player_t
*
98
libvlc_media_list_player_retain
(
libvlc_media_list_player_t
*p_mlp );
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
*/
108
LIBVLC_API
libvlc_media_player_t
*
109
libvlc_media_list_player_get_media_player
(
libvlc_media_list_player_t
* p_mlp);
110
111
/**
112
* Set the media list associated with the player
113
*
114
* If the current media is part of the new list, it keeps playing and the
115
* playback continues from its position in the new list. Otherwise, the
116
* playback switches to the first media that followed it in the previous
117
* list and is part of the new one, or stops if there is none.
118
*
119
* \param p_mlp media list player instance
120
* \param p_mlist list of media
121
*
122
* \note the caller must not hold p_mlist's lock
123
* (libvlc_media_list_lock()) when calling this function.
124
*/
125
LIBVLC_API
void
126
libvlc_media_list_player_set_media_list
(
127
libvlc_media_list_player_t
* p_mlp,
128
libvlc_media_list_t
* p_mlist );
129
130
/**
131
* Play media list
132
*
133
* \param p_mlp media list player instance
134
*/
135
LIBVLC_API
136
void
libvlc_media_list_player_play
(
libvlc_media_list_player_t
* p_mlp);
137
138
/**
139
* Toggle pause (or resume) media list
140
*
141
* \param p_mlp media list player instance
142
*/
143
LIBVLC_API
144
void
libvlc_media_list_player_pause
(
libvlc_media_list_player_t
* p_mlp);
145
146
/**
147
* Pause or resume media list
148
*
149
* \param p_mlp media list player instance
150
* \param do_pause play/resume if zero, pause if non-zero
151
* \version LibVLC 3.0.0 or later
152
*/
153
LIBVLC_API
154
void
libvlc_media_list_player_set_pause
(
libvlc_media_list_player_t
* p_mlp,
155
int
do_pause);
156
157
/**
158
* Is media list playing?
159
*
160
* \param p_mlp media list player instance
161
*
162
* \retval true playing
163
* \retval false not playing
164
*/
165
LIBVLC_API
bool
166
libvlc_media_list_player_is_playing
(
libvlc_media_list_player_t
* p_mlp);
167
168
/**
169
* Get current libvlc_state of media list player
170
*
171
* \param p_mlp media list player instance
172
* \return libvlc_state_t for media list player
173
*/
174
LIBVLC_API
libvlc_state_t
175
libvlc_media_list_player_get_state
(
libvlc_media_list_player_t
* p_mlp );
176
177
/**
178
* Play media list item at position index
179
*
180
* \param p_mlp media list player instance
181
* \param i_index index in media list to play
182
* \return 0 upon success -1 if the item wasn't found
183
*/
184
LIBVLC_API
185
int
libvlc_media_list_player_play_item_at_index
(
libvlc_media_list_player_t
* p_mlp,
186
int
i_index);
187
188
/**
189
* Play the given media item
190
*
191
* \param p_mlp media list player instance
192
* \param p_md the media instance
193
* \return 0 upon success, -1 if the media is not part of the media list
194
*/
195
LIBVLC_API
196
int
libvlc_media_list_player_play_item
(
libvlc_media_list_player_t
* p_mlp,
197
libvlc_media_t
* p_md);
198
199
/**
200
* Stop playing media list
201
*
202
* \param p_mlp media list player instance
203
*/
204
LIBVLC_API
void
205
libvlc_media_list_player_stop_async
(
libvlc_media_list_player_t
* p_mlp);
206
207
/**
208
* Play next item from media list
209
*
210
* \param p_mlp media list player instance
211
* \return 0 upon success -1 if there is no next item
212
*/
213
LIBVLC_API
214
int
libvlc_media_list_player_next
(
libvlc_media_list_player_t
* p_mlp);
215
216
/**
217
* Play previous item from media list
218
*
219
* \param p_mlp media list player instance
220
* \return 0 upon success -1 if there is no previous item
221
*/
222
LIBVLC_API
223
int
libvlc_media_list_player_previous
(
libvlc_media_list_player_t
* p_mlp);
224
225
226
227
/**
228
* Sets the playback mode for the playlist
229
*
230
* \param p_mlp media list player instance
231
* \param e_mode playback mode specification
232
*/
233
LIBVLC_API
234
void
libvlc_media_list_player_set_playback_mode
(
libvlc_media_list_player_t
* p_mlp,
235
libvlc_playback_mode_t
e_mode );
236
237
/** @} media_list_player */
238
239
# ifdef __cplusplus
240
}
241
# endif
242
243
#endif
/* LIBVLC_MEDIA_LIST_PLAYER_H */
libvlc_instance_t
struct libvlc_instance_t libvlc_instance_t
This structure is opaque.
Definition
libvlc.h:76
libvlc_media_list_player_retain
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.
libvlc_media_list_player_play
void libvlc_media_list_player_play(libvlc_media_list_player_t *p_mlp)
Play media list.
libvlc_media_list_player_play_item_at_index
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_media_list_player_pause
void libvlc_media_list_player_pause(libvlc_media_list_player_t *p_mlp)
Toggle pause (or resume) media list.
libvlc_playback_mode_t
libvlc_playback_mode_t
Defines playback modes for playlist.
Definition
libvlc_media_list_player.h:56
libvlc_media_list_player_previous
int libvlc_media_list_player_previous(libvlc_media_list_player_t *p_mlp)
Play previous item from media list.
libvlc_media_list_player_t
struct libvlc_media_list_player_t libvlc_media_list_player_t
Definition
libvlc_media_list_player.h:50
libvlc_media_list_player_play_item
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_media_list_player_next
int libvlc_media_list_player_next(libvlc_media_list_player_t *p_mlp)
Play next item from media list.
libvlc_media_list_player_get_state
libvlc_state_t libvlc_media_list_player_get_state(libvlc_media_list_player_t *p_mlp)
Get current libvlc_state of media list player.
libvlc_media_list_player_set_playback_mode
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_release
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_new
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_list_player_get_media_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.
libvlc_media_list_player_stop_async
void libvlc_media_list_player_stop_async(libvlc_media_list_player_t *p_mlp)
Stop playing media list.
libvlc_media_list_player_is_playing
bool libvlc_media_list_player_is_playing(libvlc_media_list_player_t *p_mlp)
Is media list playing?
libvlc_media_list_player_set_pause
void libvlc_media_list_player_set_pause(libvlc_media_list_player_t *p_mlp, int do_pause)
Pause or resume media list.
libvlc_media_list_player_set_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
@ libvlc_playback_mode_repeat
Definition
libvlc_media_list_player.h:59
libvlc_playback_mode_loop
@ libvlc_playback_mode_loop
Definition
libvlc_media_list_player.h:58
libvlc_playback_mode_default
@ libvlc_playback_mode_default
Definition
libvlc_media_list_player.h:57
libvlc_media_list_t
struct libvlc_media_list_t libvlc_media_list_t
Definition
libvlc_media_list.h:40
libvlc_media_player_t
struct libvlc_media_player_t libvlc_media_player_t
Definition
libvlc_media_list_player.h:34
libvlc_state_t
libvlc_state_t
libvlc media or media_player state
Definition
libvlc_media.h:85
libvlc_media_t
struct libvlc_media_t libvlc_media_t
Definition
libvlc_media.h:47
LIBVLC_API
#define LIBVLC_API
Definition
libvlc.h:42
libvlc.h
LibVLC core external API.
libvlc_media_player.h
LibVLC simple media player external API.
libvlc_media_player_cbs
struct defining callbacks for libvlc_media_player_new()
Definition
libvlc_media_player.h:231
include
vlc
libvlc_media_list_player.h
Generated by
1.15.0