VLC
4.0.0-dev
Loading...
Searching...
No Matches
libvlc_media_list.h
Go to the documentation of this file.
1
/*****************************************************************************
2
* libvlc_media_list.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_H
24
#define LIBVLC_MEDIA_LIST_H 1
25
26
typedef
struct
libvlc_media_t
libvlc_media_t
;
27
28
# ifdef __cplusplus
29
extern
"C"
{
30
# endif
31
32
/** \defgroup libvlc_media_list LibVLC media list
33
* \ingroup libvlc
34
* A LibVLC media list holds multiple @ref libvlc_media_t media descriptors.
35
* @{
36
* \file
37
* LibVLC media list (playlist) external API
38
*/
39
40
typedef
struct
libvlc_media_list_t
libvlc_media_list_t
;
41
42
/**
43
* Create an empty media list.
44
*
45
* \return empty media list, or NULL on error
46
*/
47
LIBVLC_API
libvlc_media_list_t
*
libvlc_media_list_new
(
void
);
48
49
/**
50
* Release media list created with libvlc_media_list_new().
51
*
52
* \param p_ml a media list created with libvlc_media_list_new()
53
*/
54
LIBVLC_API
void
55
libvlc_media_list_release
(
libvlc_media_list_t
*p_ml );
56
57
/**
58
* Retain reference to a media list
59
*
60
* \param p_ml a media list created with libvlc_media_list_new()
61
* \return the same object
62
*/
63
LIBVLC_API
libvlc_media_list_t
*
64
libvlc_media_list_retain
(
libvlc_media_list_t
*p_ml );
65
66
/**
67
* Associate media instance with this media list instance.
68
* If another media instance was present it will be released.
69
* The libvlc_media_list_lock should NOT be held upon entering this function.
70
*
71
* \param p_ml a media list instance
72
* \param p_md media instance to add
73
*/
74
LIBVLC_API
void
75
libvlc_media_list_set_media
(
libvlc_media_list_t
*p_ml,
libvlc_media_t
*p_md );
76
77
/**
78
* Get media instance from this media list instance. This action will increase
79
* the refcount on the media instance.
80
* The libvlc_media_list_lock should NOT be held upon entering this function.
81
*
82
* \param p_ml a media list instance
83
* \return media instance
84
*/
85
LIBVLC_API
libvlc_media_t
*
86
libvlc_media_list_media
(
libvlc_media_list_t
*p_ml );
87
88
/**
89
* Add media instance to media list
90
* The libvlc_media_list_lock should be held upon entering this function.
91
*
92
* \param p_ml a media list instance
93
* \param p_md a media instance
94
* \return 0 on success, -1 if the media list is read-only
95
*/
96
LIBVLC_API
int
97
libvlc_media_list_add_media
(
libvlc_media_list_t
*p_ml,
libvlc_media_t
*p_md );
98
99
/**
100
* Insert media instance in media list on a position
101
* The libvlc_media_list_lock should be held upon entering this function.
102
*
103
* \param p_ml a media list instance
104
* \param p_md a media instance
105
* \param i_pos position in array where to insert
106
* \return 0 on success, -1 if the media list is read-only
107
*/
108
LIBVLC_API
int
109
libvlc_media_list_insert_media
(
libvlc_media_list_t
*p_ml,
110
libvlc_media_t
*p_md,
int
i_pos );
111
112
/**
113
* Remove media instance from media list on a position
114
* The libvlc_media_list_lock should be held upon entering this function.
115
*
116
* \param p_ml a media list instance
117
* \param i_pos position in array where to insert
118
* \return 0 on success, -1 if the list is read-only or the item was not found
119
*/
120
LIBVLC_API
int
121
libvlc_media_list_remove_index
(
libvlc_media_list_t
*p_ml,
int
i_pos );
122
123
/**
124
* Get count on media list items
125
* The libvlc_media_list_lock should be held upon entering this function.
126
*
127
* \param p_ml a media list instance
128
* \return number of items in media list
129
*/
130
LIBVLC_API
int
131
libvlc_media_list_count
(
libvlc_media_list_t
*p_ml );
132
133
/**
134
* List media instance in media list at a position
135
* The libvlc_media_list_lock should be held upon entering this function.
136
*
137
* \param p_ml a media list instance
138
* \param i_pos position in array where to insert
139
* \return media instance at position i_pos, or NULL if not found.
140
* In case of success, libvlc_media_retain() is called to increase the refcount
141
* on the media.
142
*/
143
LIBVLC_API
libvlc_media_t
*
144
libvlc_media_list_item_at_index
(
libvlc_media_list_t
*p_ml,
int
i_pos );
145
/**
146
* Find index position of List media instance in media list.
147
* Warning: the function will return the first matched position.
148
* The libvlc_media_list_lock should be held upon entering this function.
149
*
150
* \param p_ml a media list instance
151
* \param p_md media instance
152
* \return position of media instance or -1 if media not found
153
*/
154
LIBVLC_API
int
155
libvlc_media_list_index_of_item
(
libvlc_media_list_t
*p_ml,
156
libvlc_media_t
*p_md );
157
158
/**
159
* This indicates if this media list is read-only from a user point of view
160
*
161
* \param p_ml media list instance
162
* \retval true read-only
163
* \retval false read/write
164
*/
165
LIBVLC_API
bool
libvlc_media_list_is_readonly
(
libvlc_media_list_t
*p_ml);
166
167
/**
168
* Get lock on media list items
169
*
170
* \param p_ml a media list instance
171
*/
172
LIBVLC_API
void
173
libvlc_media_list_lock
(
libvlc_media_list_t
*p_ml );
174
175
/**
176
* Release lock on media list items
177
* The libvlc_media_list_lock should be held upon entering this function.
178
*
179
* \param p_ml a media list instance
180
*/
181
LIBVLC_API
void
182
libvlc_media_list_unlock
(
libvlc_media_list_t
*p_ml );
183
184
/** @} media_list */
185
186
# ifdef __cplusplus
187
}
188
# endif
189
190
#endif
/* _LIBVLC_MEDIA_LIST_H */
libvlc_media_list_remove_index
LIBVLC_API int libvlc_media_list_remove_index(libvlc_media_list_t *p_ml, int i_pos)
Remove media instance from media list on a position The libvlc_media_list_lock should be held upon en...
libvlc_media_list_media
LIBVLC_API libvlc_media_t * libvlc_media_list_media(libvlc_media_list_t *p_ml)
Get media instance from this media list instance.
libvlc_media_list_retain
LIBVLC_API libvlc_media_list_t * libvlc_media_list_retain(libvlc_media_list_t *p_ml)
Retain reference to a media list.
libvlc_media_list_release
LIBVLC_API void libvlc_media_list_release(libvlc_media_list_t *p_ml)
Release media list created with libvlc_media_list_new().
libvlc_media_list_index_of_item
LIBVLC_API int libvlc_media_list_index_of_item(libvlc_media_list_t *p_ml, libvlc_media_t *p_md)
Find index position of List media instance in media list.
libvlc_media_list_is_readonly
LIBVLC_API bool libvlc_media_list_is_readonly(libvlc_media_list_t *p_ml)
This indicates if this media list is read-only from a user point of view.
libvlc_media_list_new
LIBVLC_API libvlc_media_list_t * libvlc_media_list_new(void)
Create an empty media list.
libvlc_media_list_lock
LIBVLC_API void libvlc_media_list_lock(libvlc_media_list_t *p_ml)
Get lock on media list items.
libvlc_media_list_count
LIBVLC_API int libvlc_media_list_count(libvlc_media_list_t *p_ml)
Get count on media list items The libvlc_media_list_lock should be held upon entering this function.
libvlc_media_list_set_media
LIBVLC_API void libvlc_media_list_set_media(libvlc_media_list_t *p_ml, libvlc_media_t *p_md)
Associate media instance with this media list instance.
libvlc_media_list_insert_media
LIBVLC_API int libvlc_media_list_insert_media(libvlc_media_list_t *p_ml, libvlc_media_t *p_md, int i_pos)
Insert media instance in media list on a position The libvlc_media_list_lock should be held upon ente...
libvlc_media_list_t
struct libvlc_media_list_t libvlc_media_list_t
Definition
libvlc_media_list.h:40
libvlc_media_list_unlock
LIBVLC_API void libvlc_media_list_unlock(libvlc_media_list_t *p_ml)
Release lock on media list items The libvlc_media_list_lock should be held upon entering this functio...
libvlc_media_list_item_at_index
LIBVLC_API libvlc_media_t * libvlc_media_list_item_at_index(libvlc_media_list_t *p_ml, int i_pos)
List media instance in media list at a position The libvlc_media_list_lock should be held upon enteri...
libvlc_media_list_add_media
LIBVLC_API int libvlc_media_list_add_media(libvlc_media_list_t *p_ml, libvlc_media_t *p_md)
Add media instance to media list The libvlc_media_list_lock should be held upon entering this functio...
libvlc_media_t
struct libvlc_media_t libvlc_media_t
Definition
libvlc_media.h:47
LIBVLC_API
#define LIBVLC_API
Definition
libvlc.h:42
include
vlc
libvlc_media_list.h
Generated by
1.15.0