]> git.sesse.net Git - vlc/blob - include/vlc/deprecated.h
activex: take lock before accessing libvlc_playlist_items_count().
[vlc] / include / vlc / deprecated.h
1 /*****************************************************************************
2  * deprecated.h:  libvlc deprecated 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@videolan.org>
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_DEPRECATED_H
26 #define LIBVLC_DEPRECATED_H 1
27
28 /**
29  * \file
30  * This file defines libvlc depreceated API
31  */
32
33 /**
34  * This is the legacy representation of a platform-specific drawable. Because
35  * it cannot accomodate a pointer on most 64-bits platforms, it should not be
36  * used anymore.
37  */
38 typedef int libvlc_drawable_t;
39
40 # ifdef __cplusplus
41 extern "C" {
42 # endif
43
44 /**
45  * Set the drawable where the media player should render its video output.
46  *
47  * On Windows 32-bits, a window handle (HWND) is expected.
48  * On Windows 64-bits, this function will always fail.
49  *
50  * On OSX 32-bits, a CGrafPort is expected.
51  * On OSX 64-bits, this function will always fail.
52  *
53  * On other platforms, an existing X11 window ID is expected. See
54  * libvlc_media_player_set_xid() for details.
55  *
56  * \param p_mi the Media Player
57  * \param drawable the libvlc_drawable_t where the media player
58  *        should render its video
59  * \param p_e an initialized exception pointer
60  */
61 VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
62
63 /**
64  * Get the drawable where the media player should render its video output
65  *
66  * \param p_mi the Media Player
67  * \param p_e an initialized exception pointer
68  * \return the libvlc_drawable_t where the media player
69  *         should render its video
70  */
71 VLC_PUBLIC_API libvlc_drawable_t
72                     libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
73
74 /**
75  * Set the default video output's parent.
76  *
77  * This setting will be used as default for any video output.
78  *
79  * \param p_instance libvlc instance
80  * \param drawable the new parent window
81  *                 (see libvlc_media_player_set_drawable() for details)
82  * \param p_e an initialized exception pointer
83  * @deprecated Use libvlc_media_player_set_drawable
84  */
85 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
86
87 /**
88  * Set the default video output parent.
89  *
90  * This setting will be used as default for all video outputs.
91  *
92  * \param p_instance libvlc instance
93  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
94  * \param p_e an initialized exception pointer
95  * @deprecated Use libvlc_media_player_get_drawable
96  */
97 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
98
99 /**
100  * Change the parent for the current the video output.
101  *
102  * \param p_instance libvlc instance
103  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
104  * \param p_e an initialized exception pointer
105  * \return the success status (boolean)
106  */
107 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
108
109 /*
110  * This function shall not be used at all. It may lead to crash and race condition.
111  */
112 VLC_DEPRECATED_API int libvlc_video_destroy( libvlc_media_player_t *, libvlc_exception_t *);
113
114 /*****************************************************************************
115  * Playlist (Deprecated)
116  *****************************************************************************/
117 /** \defgroup libvlc_playlist libvlc_playlist (Deprecated)
118  * \ingroup libvlc
119  * LibVLC Playlist handling (Deprecated)
120  * @deprecated Use media_list
121  * @{
122  */
123
124 /**
125  * Set the playlist's loop attribute. If set, the playlist runs continuously
126  * and wraps around when it reaches the end.
127  *
128  * \param p_instance the playlist instance
129  * \param loop the loop attribute. 1 sets looping, 0 disables it
130  * \param p_e an initialized exception pointer
131  */
132 VLC_DEPRECATED_API void libvlc_playlist_loop( libvlc_instance_t* , int,
133                                           libvlc_exception_t * );
134
135 /**
136  * Start playing.
137  *
138  * Additionnal playlist item options can be specified for addition to the
139  * item before it is played.
140  *
141  * \param p_instance the playlist instance
142  * \param i_id the item to play. If this is a negative number, the next
143  *        item will be selected. Otherwise, the item with the given ID will be
144  *        played
145  * \param i_options the number of options to add to the item
146  * \param ppsz_options the options to add to the item
147  * \param p_e an initialized exception pointer
148  */
149 VLC_DEPRECATED_API void libvlc_playlist_play( libvlc_instance_t*, int, int,
150                                           char **, libvlc_exception_t * );
151
152 /**
153  * Toggle the playlist's pause status.
154  *
155  * If the playlist was running, it is paused. If it was paused, it is resumed.
156  *
157  * \param p_instance the playlist instance to pause
158  * \param p_e an initialized exception pointer
159  */
160 VLC_DEPRECATED_API void libvlc_playlist_pause( libvlc_instance_t *,
161                                            libvlc_exception_t * );
162
163 /**
164  * Checks whether the playlist is running
165  *
166  * \param p_instance the playlist instance
167  * \param p_e an initialized exception pointer
168  * \return 0 if the playlist is stopped or paused, 1 if it is running
169  */
170 VLC_DEPRECATED_API int libvlc_playlist_isplaying( libvlc_instance_t *,
171                                               libvlc_exception_t * );
172
173 /**
174  * Get the number of items in the playlist
175  *
176  * Expects the playlist instance to be locked already.
177  *
178  * \param p_instance the playlist instance
179  * \param p_e an initialized exception pointer
180  * \return the number of items
181  */
182 VLC_DEPRECATED_API int libvlc_playlist_items_count( libvlc_instance_t *,
183                                                 libvlc_exception_t * );
184
185 VLC_DEPRECATED_API int libvlc_playlist_get_current_index( libvlc_instance_t *,
186                                                  libvlc_exception_t *);
187 /**
188  * Lock the playlist.
189  *
190  * \param p_instance the playlist instance
191  */
192 VLC_DEPRECATED_API void libvlc_playlist_lock( libvlc_instance_t * );
193
194 /**
195  * Unlock the playlist.
196  *
197  * \param p_instance the playlist instance
198  */
199 VLC_DEPRECATED_API void libvlc_playlist_unlock( libvlc_instance_t * );
200
201 /**
202  * Stop playing.
203  *
204  * \param p_instance the playlist instance to stop
205  * \param p_e an initialized exception pointer
206  */
207 VLC_DEPRECATED_API void libvlc_playlist_stop( libvlc_instance_t *,
208                                           libvlc_exception_t * );
209
210 /**
211  * Go to the next playlist item. If the playlist was stopped, playback
212  * is started.
213  *
214  * \param p_instance the playlist instance
215  * \param p_e an initialized exception pointer
216  */
217 VLC_DEPRECATED_API void libvlc_playlist_next( libvlc_instance_t *,
218                                           libvlc_exception_t * );
219
220 /**
221  * Go to the previous playlist item. If the playlist was stopped, playback
222  * is started.
223  *
224  * \param p_instance the playlist instance
225  * \param p_e an initialized exception pointer
226  */
227 VLC_DEPRECATED_API void libvlc_playlist_prev( libvlc_instance_t *,
228                                           libvlc_exception_t * );
229
230 /**
231  * Empty a playlist. All items in the playlist are removed.
232  *
233  * \param p_instance the playlist instance
234  * \param p_e an initialized exception pointer
235  */
236 VLC_DEPRECATED_API void libvlc_playlist_clear( libvlc_instance_t *,
237                                            libvlc_exception_t * );
238
239 /**
240  * Append an item to the playlist. The item is added at the end. If more
241  * advanced options are required, \see libvlc_playlist_add_extended instead.
242  *
243  * \param p_instance the playlist instance
244  * \param psz_uri the URI to open, using VLC format
245  * \param psz_name a name that you might want to give or NULL
246  * \param p_e an initialized exception pointer
247  * \return the identifier of the new item
248  */
249 VLC_DEPRECATED_API int libvlc_playlist_add( libvlc_instance_t *, const char *,
250                                         const char *, libvlc_exception_t * );
251
252 /**
253  * Append an item to the playlist. The item is added at the end, with
254  * additional input options.
255  *
256  * \param p_instance the playlist instance
257  * \param psz_uri the URI to open, using VLC format
258  * \param psz_name a name that you might want to give or NULL
259  * \param i_options the number of options to add
260  * \param ppsz_options strings representing the options to add
261  * \param p_e an initialized exception pointer
262  * \return the identifier of the new item
263  */
264 VLC_DEPRECATED_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
265                                                  const char *, int, const char **,
266                                                  libvlc_exception_t * );
267
268 /**
269  * Append an item to the playlist. The item is added at the end, with
270  * additional input options from an untrusted source.
271  *
272  * \param p_instance the playlist instance
273  * \param psz_uri the URI to open, using VLC format
274  * \param psz_name a name that you might want to give or NULL
275  * \param i_options the number of options to add
276  * \param ppsz_options strings representing the options to add
277  * \param p_e an initialized exception pointer
278  * \return the identifier of the new item
279  */
280 VLC_DEPRECATED_API int libvlc_playlist_add_extended_untrusted( libvlc_instance_t *, const char *,
281                                                  const char *, int, const char **,
282                                                  libvlc_exception_t * );
283
284 /**
285  * Delete the playlist item with the given ID.
286  *
287  * \param p_instance the playlist instance
288  * \param i_id the id to remove
289  * \param p_e an initialized exception pointer
290  * \return 0 in case of success, a non-zero value otherwise
291  */
292 VLC_DEPRECATED_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
293                                                 libvlc_exception_t * );
294
295 /** Get the input that is currently being played by the playlist.
296  *
297  * \param p_instance the playlist instance to use
298  * \param p_e an initialized exception pointern
299  * \return a media instance object
300  */
301 VLC_DEPRECATED_API libvlc_media_player_t * libvlc_playlist_get_media_player(
302                                 libvlc_instance_t *, libvlc_exception_t * );
303
304 /** @}*/
305
306 # ifdef __cplusplus
307 }
308 # endif
309
310 #endif /* _LIBVLC_DEPRECATED_H */