]> git.sesse.net Git - vlc/blob - include/vlc/libvlc.h
* get/set/toggle fullscreen
[vlc] / include / vlc / libvlc.h
1 /*****************************************************************************
2  * libvlc.h:  libvlc_* new external API
3  *****************************************************************************
4  * Copyright (C) 1998-2005 the VideoLAN team
5  * $Id: vlc.h 13701 2005-12-12 17:58:56Z zorglub $
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 /**
25  * \defgroup libvlc Libvlc
26  * This is libvlc, the base library of the VLC program.
27  *
28  * @{
29  */
30
31
32 #ifndef _LIBVLC_H
33 #define _LIBVLC_H 1
34
35 #include <vlc/vlc.h>
36
37 # ifdef __cplusplus
38 extern "C" {
39 # endif
40
41 /*****************************************************************************
42  * Exception handling
43  *****************************************************************************/
44 /** defgroup libvlc_exception Exceptions
45  * \ingroup libvlc
46  * LibVLC Exceptions handling
47  * @{
48  */
49
50 struct libvlc_exception_t
51 {
52     int b_raised;
53     char *psz_message;
54 };
55 typedef struct libvlc_exception_t libvlc_exception_t;
56
57 /**
58  * Initialize an exception structure. This can be called several times to reuse
59  * an exception structure.
60  * \param p_exception the exception to initialize
61  */
62 void libvlc_exception_init( libvlc_exception_t *p_exception );
63
64 /**
65  * Has an exception been raised ?
66  * \param p_exception the exception to query
67  * \return 0 if no exception raised, 1 else
68  */
69 int libvlc_exception_raised( libvlc_exception_t *p_exception );
70
71 /**
72  * Raise an exception
73  * \param p_exception the exception to raise
74  * \param psz_message the exception message
75  */
76 void libvlc_exception_raise( libvlc_exception_t *p_exception, char *psz_message );
77
78 /**
79  * Clear an exception object so it can be reused.
80  * The exception object must be initialized
81  * \param p_exception the exception to clear
82  */
83 void libvlc_exception_clear( libvlc_exception_t * );
84
85 /**
86  * Get exception message
87  * \param p_exception the exception to query
88  * \return the exception message or NULL if not applicable (exception not raised
89  * for example)
90  */
91 char* libvlc_exception_get_message( libvlc_exception_t *p_exception );
92
93
94
95 /** @} */
96
97 /*****************************************************************************
98  * Core handling
99  *****************************************************************************/
100
101 /** defgroup libvlc_core Core
102  * \ingroup libvlc
103  * LibVLC Core
104  * @{
105  */
106
107 /** This structure is opaque. It represents a libvlc instance */
108 typedef struct libvlc_instance_t libvlc_instance_t;
109
110 /**
111  * Create an initialized libvlc instance
112  * \param argc the number of arguments
113  * \param argv command-line-type arguments
114  * \param exception an initialized exception pointer
115  */
116 libvlc_instance_t * libvlc_new( int , char **, libvlc_exception_t *);
117
118 /**
119  * Destroy a libvlc instance
120  * \param p_instance the instance to destroy
121  */
122 void libvlc_destroy( libvlc_instance_t *);
123
124 /** @}*/
125
126 /*****************************************************************************
127  * Playlist
128  *****************************************************************************/
129 /** defgroup libvlc_playlist Playlist
130  * \ingroup libvlc
131  * LibVLC Playlist handling
132  * @{
133  */
134
135 /**
136  * Start playing. You can give some additionnal playlist item options
137  * that will be added to the item before playing it.
138  * \param p_instance the instance
139  * \param i_id the item to play. If this is a negative number, the next
140  * item will be selected. Else, the item with the given ID will be played
141  * \param i_options the number of options to add to the item
142  * \param ppsz_options the options to add to the item
143  * \param p_exception an initialized exception
144  */
145 void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
146                            libvlc_exception_t * );
147
148 /**
149  * Stop playing
150  * \param p_instance the instance to stop
151  * \param p_exception an initialized exception
152  */
153 void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
154
155 /**
156  * Remove all playlist ites
157  * \param p_instance the instance
158  * \param p_exception an initialized exception
159  */
160 void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
161
162 /**
163  * Go to next playlist item
164  * \param p_instance the instance
165  * \param p_exception an initialized exception
166  */
167 void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
168
169 /**
170  * Go to Previous playlist item
171  * \param p_instance the instance
172  * \param p_exception an initialized exception
173  */
174 void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
175
176 /**
177  * Add an item at the end of the playlist
178  * If you need more advanced options, \see libvlc_playlist_add_extended
179  * \param p_instance the instance
180  * \param psz_uri the URI to open, using VLC format
181  * \param psz_name a name that you might want to give or NULL
182  * \return the identifier of the new item
183  */
184 int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
185                          libvlc_exception_t * );
186
187 /**
188  * Add an item at the end of the playlist, with additional input options
189  * \param p_instance the instance
190  * \param psz_uri the URI to open, using VLC format
191  * \param psz_name a name that you might want to give or NULL
192  * \param i_options the number of options to add
193  * \param ppsz_options strings representing the options to add
194  * \return the identifier of the new item
195  */
196 int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
197                                   const char *, int, const char **,
198                                   libvlc_exception_t * );
199
200
201
202
203 typedef struct libvlc_input_t libvlc_input_t;
204
205 ///\todo document me
206 libvlc_input_t *libvlc_playlist_get_input( libvlc_instance_t *,
207                                            libvlc_exception_t * );
208
209
210
211 /** @}*/
212
213 /*****************************************************************************
214  * Input
215  *****************************************************************************/
216 /** defgroup libvlc_input Input
217  * \ingroup libvlc
218  * LibVLC Input handling
219  * @{
220  */
221
222 /** Free an input object
223  * \param p_input the input to free
224  */
225 void libvlc_input_free( libvlc_input_t * );
226
227 /// \bug This might go away ... to be replaced by a broader system
228 vlc_int64_t libvlc_input_get_length( libvlc_input_t *, libvlc_exception_t *);
229 vlc_int64_t libvlc_input_get_time( libvlc_input_t *, libvlc_exception_t *);
230 float libvlc_input_get_position( libvlc_input_t *, libvlc_exception_t *);
231
232
233 void libvlc_toggle_fullscreen( libvlc_input_t *, libvlc_exception_t * );
234
235
236 /** @} */
237
238
239
240 # ifdef __cplusplus
241 }
242 # endif
243
244 #endif /* <vlc/vlc_control.h> */