]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_vlm.h
Doxygen updates
[vlc] / include / vlc / libvlc_vlm.h
1 /*****************************************************************************
2  * libvlc_vlm.h:  libvlc_* new external API
3  *****************************************************************************
4  * Copyright (C) 1998-2008 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifndef LIBVLC_VLM_H
26 #define LIBVLC_VLM_H 1
27
28 /**
29  * \file
30  * This file defines libvlc_vlm_* external API
31  */
32
33 # ifdef __cplusplus
34 extern "C" {
35 # endif
36
37 /*****************************************************************************
38  * VLM
39  *****************************************************************************/
40 /** \defgroup libvlc_vlm libvlc_vlm
41  * \ingroup libvlc
42  * LibVLC VLM
43  * @{
44  */
45
46
47 /**
48  * Release the vlm instance related to the given libvlc_instance_t
49  *
50  * \param p_instance the instance
51  */
52 VLC_PUBLIC_API void libvlc_vlm_release( libvlc_instance_t * );
53
54 /**
55  * Add a broadcast, with one input.
56  *
57  * \param p_instance the instance
58  * \param psz_name the name of the new broadcast
59  * \param psz_input the input MRL
60  * \param psz_output the output MRL (the parameter to the "sout" variable)
61  * \param i_options number of additional options
62  * \param ppsz_options additional options
63  * \param b_enabled boolean for enabling the new broadcast
64  * \param b_loop Should this broadcast be played in loop ?
65  * \return 0 on success, -1 on error
66  */
67 VLC_PUBLIC_API int libvlc_vlm_add_broadcast( libvlc_instance_t *,
68                                              const char *, const char *,
69                                              const char * , int,
70                                              const char * const*,
71                                              int, int );
72
73 /**
74  * Add a vod, with one input.
75  *
76  * \param p_instance the instance
77  * \param psz_name the name of the new vod media
78  * \param psz_input the input MRL
79  * \param i_options number of additional options
80  * \param ppsz_options additional options
81  * \param b_enabled boolean for enabling the new vod
82  * \param psz_mux the muxer of the vod media
83  * \param 0 on success, -1 on error
84  */
85 VLC_PUBLIC_API int libvlc_vlm_add_vod( libvlc_instance_t *,
86                                        const char *, const char *,
87                                        int, const char * const*,
88                                         int, const char * );
89
90 /**
91  * Delete a media (VOD or broadcast).
92  *
93  * \param p_instance the instance
94  * \param psz_name the media to delete
95  * \return 0 on success, -1 on error
96  */
97 VLC_PUBLIC_API int libvlc_vlm_del_media( libvlc_instance_t *, const char * );
98
99 /**
100  * Enable or disable a media (VOD or broadcast).
101  *
102  * \param p_instance the instance
103  * \param psz_name the media to work on
104  * \param b_enabled the new status
105  * \return 0 on success, -1 on error
106  */
107 VLC_PUBLIC_API int libvlc_vlm_set_enabled( libvlc_instance_t *, const char *,
108                                            int );
109
110 /**
111  * Set the output for a media.
112  *
113  * \param p_instance the instance
114  * \param psz_name the media to work on
115  * \param psz_output the output MRL (the parameter to the "sout" variable)
116  * \return 0 on success, -1 on error
117  */
118 VLC_PUBLIC_API int libvlc_vlm_set_output( libvlc_instance_t *, const char *,
119                                           const char * );
120
121 /**
122  * Set a media's input MRL. This will delete all existing inputs and
123  * add the specified one.
124  *
125  * \param p_instance the instance
126  * \param psz_name the media to work on
127  * \param psz_input the input MRL
128  * \return 0 on success, -1 on error
129  */
130 VLC_PUBLIC_API int libvlc_vlm_set_input( libvlc_instance_t *, const char *,
131                                          const char * );
132
133 /**
134  * Add a media's input MRL. This will add the specified one.
135  *
136  * \param p_instance the instance
137  * \param psz_name the media to work on
138  * \param psz_input the input MRL
139  * \return 0 on success, -1 on error
140  */
141 VLC_PUBLIC_API int libvlc_vlm_add_input( libvlc_instance_t *, const char *,
142                                          const char * );
143
144 /**
145  * Set a media's loop status.
146  *
147  * \param p_instance the instance
148  * \param psz_name the media to work on
149  * \param b_loop the new status
150  * \return 0 on success, -1 on error
151  */
152 VLC_PUBLIC_API int libvlc_vlm_set_loop( libvlc_instance_t *, const char *,
153                                         int );
154
155 /**
156  * Set a media's vod muxer.
157  *
158  * \param p_instance the instance
159  * \param psz_name the media to work on
160  * \param psz_mux the new muxer
161  * \return 0 on success, -1 on error
162  */
163 VLC_PUBLIC_API int libvlc_vlm_set_mux( libvlc_instance_t *, const char *,
164                                        const char * );
165
166 /**
167  * Edit the parameters of a media. This will delete all existing inputs and
168  * add the specified one.
169  *
170  * \param p_instance the instance
171  * \param psz_name the name of the new broadcast
172  * \param psz_input the input MRL
173  * \param psz_output the output MRL (the parameter to the "sout" variable)
174  * \param i_options number of additional options
175  * \param ppsz_options additional options
176  * \param b_enabled boolean for enabling the new broadcast
177  * \param b_loop Should this broadcast be played in loop ?
178  * \return 0 on success, -1 on error
179  */
180 VLC_PUBLIC_API int libvlc_vlm_change_media( libvlc_instance_t *,
181                                             const char *, const char *,
182                                             const char* , int,
183                                             const char * const *, int, int );
184
185 /**
186  * Play the named broadcast.
187  *
188  * \param p_instance the instance
189  * \param psz_name the name of the broadcast
190  * \return 0 on success, -1 on error
191  */
192 VLC_PUBLIC_API int libvlc_vlm_play_media ( libvlc_instance_t *, const char * );
193
194 /**
195  * Stop the named broadcast.
196  *
197  * \param p_instance the instance
198  * \param psz_name the name of the broadcast
199  * \return 0 on success, -1 on error
200  */
201 VLC_PUBLIC_API int libvlc_vlm_stop_media ( libvlc_instance_t *, const char * );
202
203 /**
204  * Pause the named broadcast.
205  *
206  * \param p_instance the instance
207  * \param psz_name the name of the broadcast
208  * \return 0 on success, -1 on error
209  */
210 VLC_PUBLIC_API int libvlc_vlm_pause_media( libvlc_instance_t *, const char * );
211
212 /**
213  * Seek in the named broadcast.
214  *
215  * \param p_instance the instance
216  * \param psz_name the name of the broadcast
217  * \param f_percentage the percentage to seek to
218  * \return 0 on success, -1 on error
219  */
220 VLC_PUBLIC_API int libvlc_vlm_seek_media( libvlc_instance_t *, const char *,
221                                           float );
222
223 /**
224  * Return information about the named media as a JSON
225  * string representation.
226  *
227  * This function is mainly intended for debugging use,
228  * if you want programmatic access to the state of
229  * a vlm_media_instance_t, please use the corresponding
230  * libvlc_vlm_get_media_instance_xxx -functions.
231  * Currently there are no such functions available for
232  * vlm_media_t though.
233  *
234  * \param p_instance the instance
235  * \param psz_name the name of the media,
236  *      if the name is an empty string, all media is described
237  * \return string with information about named media, or NULL on error
238  */
239 VLC_PUBLIC_API const char* libvlc_vlm_show_media( libvlc_instance_t *,
240                                                   const char * );
241
242 /**
243  * Get vlm_media instance position by name or instance id
244  *
245  * \param p_instance a libvlc instance
246  * \param psz_name name of vlm media instance
247  * \param i_instance instance id
248  * \return position as float or -1. on error
249  */
250 VLC_PUBLIC_API float libvlc_vlm_get_media_instance_position( libvlc_instance_t *,
251                                                              const char *, int );
252
253 /**
254  * Get vlm_media instance time by name or instance id
255  *
256  * \param p_instance a libvlc instance
257  * \param psz_name name of vlm media instance
258  * \param i_instance instance id
259  * \return time as integer or -1 on error
260  */
261 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_time( libvlc_instance_t *,
262                                                        const char *, int );
263
264 /**
265  * Get vlm_media instance length by name or instance id
266  *
267  * \param p_instance a libvlc instance
268  * \param psz_name name of vlm media instance
269  * \param i_instance instance id
270  * \return length of media item or -1 on error
271  */
272 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_length( libvlc_instance_t *,
273                                                          const char *, int );
274
275 /**
276  * Get vlm_media instance playback rate by name or instance id
277  *
278  * \param p_instance a libvlc instance
279  * \param psz_name name of vlm media instance
280  * \param i_instance instance id
281  * \return playback rate or -1 on error
282  */
283 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_rate( libvlc_instance_t *,
284                                                        const char *, int );
285 #if 0
286 /**
287  * Get vlm_media instance title number by name or instance id
288  * \bug will always return 0
289  * \param p_instance a libvlc instance
290  * \param psz_name name of vlm media instance
291  * \param i_instance instance id
292  * \return title as number or -1 on error
293  */
294 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_title( libvlc_instance_t *,
295                                                         const char *, int );
296
297 /**
298  * Get vlm_media instance chapter number by name or instance id
299  * \bug will always return 0
300  * \param p_instance a libvlc instance
301  * \param psz_name name of vlm media instance
302  * \param i_instance instance id
303  * \return chapter as number or -1 on error
304  */
305 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_chapter( libvlc_instance_t *,
306                                                           const char *, int );
307
308 /**
309  * Is libvlc instance seekable ?
310  * \bug will always return 0
311  * \param p_instance a libvlc instance
312  * \param psz_name name of vlm media instance
313  * \param i_instance instance id
314  * \return 1 if seekable, 0 if not, -1 if media does not exist
315  */
316 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_seekable( libvlc_instance_t *,
317                                                            const char *, int );
318 #endif
319 /**
320  * Get libvlc_event_manager from a vlm media.
321  * The p_event_manager is immutable, so you don't have to hold the lock
322  *
323  * \param p_instance a libvlc instance
324  * \return libvlc_event_manager
325  */
326 VLC_PUBLIC_API libvlc_event_manager_t *
327     libvlc_vlm_get_event_manager( libvlc_instance_t * );
328
329 /** @} */
330
331 # ifdef __cplusplus
332 }
333 # endif
334
335 #endif /* <vlc/libvlc_vlm.h> */