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
* \param p_mlp media list player instance
115
* \param p_mlist list of media
116
*/
117
LIBVLC_API
void
118
libvlc_media_list_player_set_media_list
(
119
libvlc_media_list_player_t
* p_mlp,
120
libvlc_media_list_t
* p_mlist );
121
122
/**
123
* Play media list
124
*
125
* \param p_mlp media list player instance
126
*/
127
LIBVLC_API
128
void
libvlc_media_list_player_play
(
libvlc_media_list_player_t
* p_mlp);
129
130
/**
131
* Toggle pause (or resume) media list
132
*
133
* \param p_mlp media list player instance
134
*/
135
LIBVLC_API
136
void
libvlc_media_list_player_pause
(
libvlc_media_list_player_t
* p_mlp);
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
*/
145
LIBVLC_API
146
void
libvlc_media_list_player_set_pause
(
libvlc_media_list_player_t
* p_mlp,
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
*/
157
LIBVLC_API
bool
158
libvlc_media_list_player_is_playing
(
libvlc_media_list_player_t
* p_mlp);
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
*/
166
LIBVLC_API
libvlc_state_t
167
libvlc_media_list_player_get_state
(
libvlc_media_list_player_t
* p_mlp );
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
*/
176
LIBVLC_API
177
int
libvlc_media_list_player_play_item_at_index
(
libvlc_media_list_player_t
* p_mlp,
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
*/
187
LIBVLC_API
188
int
libvlc_media_list_player_play_item
(
libvlc_media_list_player_t
* p_mlp,
189
libvlc_media_t
* p_md);
190
191
/**
192
* Stop playing media list
193
*
194
* \param p_mlp media list player instance
195
*/
196
LIBVLC_API
void
197
libvlc_media_list_player_stop_async
(
libvlc_media_list_player_t
* p_mlp);
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
*/
205
LIBVLC_API
206
int
libvlc_media_list_player_next
(
libvlc_media_list_player_t
* p_mlp);
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
*/
214
LIBVLC_API
215
int
libvlc_media_list_player_previous
(
libvlc_media_list_player_t
* p_mlp);
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
*/
225
LIBVLC_API
226
void
libvlc_media_list_player_set_playback_mode
(
libvlc_media_list_player_t
* p_mlp,
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 */
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:84
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