VLC 4.0.0-dev
vlc_interface.h
Go to the documentation of this file.
1/*****************************************************************************
2 * vlc_interface.h: interface access for other threads
3 * This library provides basic functions for threads to interact with user
4 * interface, such as message output.
5 *****************************************************************************
6 * Copyright (C) 1999, 2000 VLC authors and VideoLAN
7 *
8 * Authors: Vincent Seguin <seguin@via.ecp.fr>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
24
25#ifndef VLC_INTF_H_
26#define VLC_INTF_H_
27
28#include <vlc_threads.h>
29
30# ifdef __cplusplus
31extern "C" {
32# endif
33
34typedef struct vlc_playlist vlc_playlist_t;
37/**
38 * \defgroup interface Interface
39 * \ingroup vlc
40 * VLC user interfaces
41 * @{
42 * \file
43 * VLC user interface modules
44 */
45
46typedef struct intf_sys_t intf_sys_t;
48/** Describe all interface-specific data of the interface thread */
49typedef struct intf_thread_t
51 struct vlc_object_t obj;
53 struct intf_thread_t *p_next; /** LibVLC interfaces book keeping */
55 /* Specific interfaces */
56 intf_sys_t * p_sys; /** system interface */
58 /** Interface module */
61 /** Specific for dialogs providers */
62 void ( *pf_show_dialog ) ( struct intf_thread_t *, int, int,
64
68/** \brief Arguments passed to a dialogs provider
69 * This describes the arguments passed to the dialogs provider. They are
70 * mainly used with INTF_DIALOG_FILE_GENERIC.
71 */
75 char *psz_title;
77 char **psz_results;
80 void (*pf_callback) ( intf_dialog_args_t * );
81 void *p_arg;
83 /* Specifically for INTF_DIALOG_FILE_GENERIC */
84 char *psz_extensions;
85 bool b_save;
88 /* Specific to INTF_DIALOG_INTERACTION */
90};
91
92VLC_API int intf_Create( libvlc_int_t *, const char * );
93
95
96/**
97 * Recover the main playlist from an interface module
98 *
99 * @return the main playlist (can't be NULL)
100 */
103
104/**
105 * @ingroup messages
106 * @{
107 */
108
110 void *data);
111
112/** @} */
113
114/* Interface dialog ids for dialog providers */
115typedef enum vlc_intf_dialog {
151/* Useful text messages shared by interfaces */
152#define INTF_ABOUT_MSG LICENSE_MSG
154#define EXTENSIONS_AUDIO_CSV "3ga", "669", "a52", "aac", "ac3", "adt", "adts", "aif", "aifc", "aiff", \
155 "amb", "amr", "aob", "ape", "au", "awb", "caf", "dts", "dsf", "dff", "flac", "it", "kar", \
156 "m4a", "m4b", "m4p", "m5p", "mka", "mlp", "mod", "mpa", "mp1", "mp2", "mp3", "mpc", "mpga", "mus", \
157 "oga", "ogg", "oma", "opus", "qcp", "ra", "rmi", "s3m", "sid", "spx", "tak", "thd", "tta", \
158 "voc", "vqf", "w64", "wav", "wma", "wv", "xa", "xm"
159
160#define EXTENSIONS_VIDEO_CSV "3g2", "3gp", "3gp2", "3gpp", "amrec", "amv", "asf", "avi", "bik", "crf", "dav", "divx", "drc", \
161 "dv", "dvr-ms", "evo", "f4v", "flv", "gvi", "gxf", "iso", \
162 "m1v", "m2v", "m2t", "m2ts", "m4v", "mkv", "mov",\
163 "mp2", "mp2v", "mp4", "mp4v", "mpe", "mpeg", "mpeg1", \
164 "mpeg2", "mpeg4", "mpg", "mpv2", "mts", "mtv", "mxf", "mxg", "nsv", "nuv", \
165 "ogg", "ogm", "ogv", "ogx", "ps", \
166 "rec", "rm", "rmvb", "rpl", "thp", "tod", "ts", "tts", "txd", "vob", "vro", \
167 "webm", "wm", "wmv", "wtv", "xesc"
168
169#define EXTENSIONS_AUDIO \
170 "*.3ga;" \
171 "*.669;" \
172 "*.a52;" \
173 "*.aac;" \
174 "*.ac3;" \
175 "*.adt;" \
176 "*.adts;" \
177 "*.aif;"\
178 "*.aifc;"\
179 "*.aiff;"\
180 "*.amb;" \
181 "*.amr;" \
182 "*.aob;" \
183 "*.ape;" \
184 "*.au;" \
185 "*.awb;" \
186 "*.caf;" \
187 "*.dts;" \
188 "*.dsf;" \
189 "*.dff;" \
190 "*.flac;"\
191 "*.it;" \
192 "*.kar;" \
193 "*.m4a;" \
194 "*.m4b;" \
195 "*.m4p;" \
196 "*.m5p;" \
197 "*.mid;" \
198 "*.mka;" \
199 "*.mlp;" \
200 "*.mod;" \
201 "*.mpa;" \
202 "*.mp1;" \
203 "*.mp2;" \
204 "*.mp3;" \
205 "*.mpc;" \
206 "*.mpga;" \
207 "*.mus;" \
208 "*.oga;" \
209 "*.ogg;" \
210 "*.oma;" \
211 "*.opus;" \
212 "*.qcp;" \
213 "*.ra;" \
214 "*.rmi;" \
215 "*.s3m;" \
216 "*.sid;" \
217 "*.spx;" \
218 "*.tak;" \
219 "*.thd;" \
220 "*.tta;" \
221 "*.voc;" \
222 "*.vqf;" \
223 "*.w64;" \
224 "*.wav;" \
225 "*.wma;" \
226 "*.wv;" \
227 "*.xa;" \
228 "*.xm"
229
230#define EXTENSIONS_VIDEO "*.3g2;*.3gp;*.3gp2;*.3gpp;*.amrec;*.amv;*.asf;*.avi;*.bik;*.bin;*.crf;*.dav;*.divx;*.drc;*.dv;*.dvr-ms;*.evo;*.f4v;*.flv;*.gvi;*.gxf;*.iso;*.m1v;*.m2v;" \
231 "*.m2t;*.m2ts;*.m4v;*.mkv;*.mov;*.mp2;*.mp2v;*.mp4;*.mp4v;*.mpe;*.mpeg;*.mpeg1;" \
232 "*.mpeg2;*.mpeg4;*.mpg;*.mpv2;*.mts;*.mtv;*.mxf;*.mxg;*.nsv;*.nuv;" \
233 "*.ogg;*.ogm;*.ogv;*.ogx;*.ps;" \
234 "*.rec;*.rm;*.rmvb;*.rpl;*.thp;*.tod;*.tp;*.ts;*.tts;*.txd;*.vob;*.vro;*.webm;*.wm;*.wmv;*.wtv;*.xesc"
235
236#define EXTENSIONS_PLAYLIST "*.asx;*.b4s;*.cue;*.ifo;*.m3u;*.m3u8;*.pls;*.ram;*.rar;*.sdp;*.vlc;*.xspf;*.wax;*.wpl;*.wvx;*.zip;*.conf"
238#define EXTENSIONS_MEDIA EXTENSIONS_VIDEO ";" EXTENSIONS_AUDIO ";" \
239 EXTENSIONS_PLAYLIST
240
241#define EXTENSIONS_SUBTITLE "*.cdg;*.idx;*.srt;" \
242 "*.sub;*.utf;*.ass;" \
243 "*.ssa;*.aqt;" \
244 "*.jss;*.psb;" \
245 "*.rt;*.sami;*.smi;*.txt;" \
246 "*.smil;*.stl;*.usf;" \
247 "*.dks;*.pjs;*.mpl2;*.mks;" \
248 "*.vtt;*.tt;*.ttml;*.dfxp;" \
249 "*.scc"
250
251/** \defgroup interaction Interaction
252 * \ingroup interface
253 * Interaction between user and modules
254 * @{
255 */
256
257/**
258 * This structure describes a piece of interaction with the user
259 */
260typedef struct interaction_dialog_t
262 int i_type; ///< Type identifier
263 char *psz_title; ///< Title
264 char *psz_description; ///< Descriptor string
265 char *psz_default_button; ///< default button title (~OK)
266 char *psz_alternate_button;///< alternate button title (~NO)
267 /// other button title (optional,~Cancel)
268 char *psz_other_button;
270 char *psz_returned[1]; ///< returned responses from the user
272 vlc_value_t val; ///< value coming from core for dialogue
273 int i_timeToGo; ///< time (in sec) until shown progress is finished
274 bool b_cancelled; ///< was the dialogue cancelled ?
276 void * p_private; ///< Private interface data
278 int i_status; ///< Dialog status;
279 int i_action; ///< Action to perform;
280 int i_flags; ///< Misc flags
281 int i_return; ///< Return status
283 vlc_object_t *p_parent; ///< The vlc object that asked
284 //for interaction
289/**
290 * Possible flags . Dialog types
291 */
292#define DIALOG_GOT_ANSWER 0x01
293#define DIALOG_YES_NO_CANCEL 0x02
294#define DIALOG_LOGIN_PW_OK_CANCEL 0x04
295#define DIALOG_PSZ_INPUT_OK_CANCEL 0x08
296#define DIALOG_BLOCKING_ERROR 0x10
297#define DIALOG_NONBLOCKING_ERROR 0x20
298#define DIALOG_USER_PROGRESS 0x80
299#define DIALOG_INTF_PROGRESS 0x100
301/** Possible return codes */
302enum
303{
307};
309/** Possible status */
310enum
311{
312 ANSWERED_DIALOG, ///< Got "answer"
313 DESTROYED_DIALOG, ///< Interface has destroyed it
315
316/** Possible actions */
317enum
318{
323};
325#define intf_UserStringInput( a, b, c, d ) (VLC_OBJECT(a),b,c,d, VLC_EGENERIC)
326#define interaction_Register( t ) (t, VLC_EGENERIC)
327#define interaction_Unregister( t ) (t, VLC_EGENERIC)
329
330/** @} */
331/** @} */
332
333# ifdef __cplusplus
334}
335# endif
336#endif
#define VLC_API
Definition: fourcc_gen.c:31
struct interaction_dialog_t interaction_dialog_t
This structure describes a piece of interaction with the user.
@ DIALOG_CANCELLED
Definition: vlc_interface.h:307
@ DIALOG_NO
Definition: vlc_interface.h:306
@ DIALOG_OK_YES
Definition: vlc_interface.h:305
@ INTERACT_UPDATE
Definition: vlc_interface.h:321
@ INTERACT_HIDE
Definition: vlc_interface.h:322
@ INTERACT_DESTROY
Definition: vlc_interface.h:323
@ INTERACT_NEW
Definition: vlc_interface.h:320
@ ANSWERED_DIALOG
Got "answer".
Definition: vlc_interface.h:313
@ DESTROYED_DIALOG
Interface has destroyed it.
Definition: vlc_interface.h:314
struct intf_sys_t intf_sys_t
Definition: vlc_interface.h:47
vlc_intf_dialog
Definition: vlc_interface.h:116
struct intf_thread_t intf_thread_t
Describe all interface-specific data of the interface thread.
int intf_Create(libvlc_int_t *, const char *)
Create and start an interface.
Definition: interface.c:132
vlc_playlist_t * vlc_intf_GetMainPlaylist(intf_thread_t *intf)
Recover the main playlist from an interface module.
Definition: interface.c:118
void libvlc_Quit(libvlc_int_t *)
Posts an exit signal to LibVLC instance.
Definition: exit.c:55
@ INTF_DIALOG_PREFS
Definition: vlc_interface.h:132
@ INTF_DIALOG_BOOKMARKS
Definition: vlc_interface.h:133
@ INTF_DIALOG_SENDKEY
Definition: vlc_interface.h:144
@ INTF_DIALOG_FILEINFO
Definition: vlc_interface.h:131
@ INTF_DIALOG_FILE_GENERIC
Definition: vlc_interface.h:142
@ INTF_DIALOG_UPDATEVLC
Definition: vlc_interface.h:146
@ INTF_DIALOG_VLM
Definition: vlc_interface.h:147
@ INTF_DIALOG_NET
Definition: vlc_interface.h:120
@ INTF_DIALOG_DIRECTORY
Definition: vlc_interface.h:123
@ INTF_DIALOG_SAT
Definition: vlc_interface.h:122
@ INTF_DIALOG_VIDEOPOPUPMENU
Definition: vlc_interface.h:139
@ INTF_DIALOG_EXTENDED
Definition: vlc_interface.h:134
@ INTF_DIALOG_POPUPMENU
Definition: vlc_interface.h:137
@ INTF_DIALOG_FILE_SIMPLE
Definition: vlc_interface.h:117
@ INTF_DIALOG_FILE
Definition: vlc_interface.h:118
@ INTF_DIALOG_CAPTURE
Definition: vlc_interface.h:121
@ INTF_DIALOG_AUDIOPOPUPMENU
Definition: vlc_interface.h:138
@ INTF_DIALOG_EXIT
Definition: vlc_interface.h:149
@ INTF_DIALOG_WIZARD
Definition: vlc_interface.h:126
@ INTF_DIALOG_STREAMWIZARD
Definition: vlc_interface.h:125
@ INTF_DIALOG_MESSAGES
Definition: vlc_interface.h:130
@ INTF_DIALOG_PLAYLIST
Definition: vlc_interface.h:128
@ INTF_DIALOG_RENDERER
Definition: vlc_interface.h:135
@ INTF_DIALOG_INTERACTION
Definition: vlc_interface.h:143
@ INTF_DIALOG_PLAYLISTS
Definition: vlc_interface.h:129
@ INTF_DIALOG_MISCPOPUPMENU
Definition: vlc_interface.h:140
@ INTF_DIALOG_DISC
Definition: vlc_interface.h:119
void vlc_LogSet(libvlc_int_t *, const struct vlc_logger_operations *, void *data)
Sets the message logging callback.
Definition: messages.c:551
Definition: vlc_configuration.h:319
This structure describes a piece of interaction with the user.
Definition: vlc_interface.h:262
intf_thread_t * p_interface
Definition: vlc_interface.h:286
bool b_cancelled
was the dialogue cancelled ?
Definition: vlc_interface.h:275
char * psz_other_button
other button title (optional,~Cancel)
Definition: vlc_interface.h:269
char * psz_description
Descriptor string.
Definition: vlc_interface.h:265
vlc_mutex_t * p_lock
Definition: vlc_interface.h:287
int i_action
Action to perform;.
Definition: vlc_interface.h:280
int i_flags
Misc flags.
Definition: vlc_interface.h:281
int i_return
Return status.
Definition: vlc_interface.h:282
int i_timeToGo
time (in sec) until shown progress is finished
Definition: vlc_interface.h:274
char * psz_returned[1]
returned responses from the user
Definition: vlc_interface.h:271
vlc_object_t * p_parent
The vlc object that asked.
Definition: vlc_interface.h:284
int i_type
Type identifier.
Definition: vlc_interface.h:263
char * psz_alternate_button
alternate button title (~NO)
Definition: vlc_interface.h:267
char * psz_title
Title.
Definition: vlc_interface.h:264
void * p_private
Private interface data.
Definition: vlc_interface.h:277
char * psz_default_button
default button title (~OK)
Definition: vlc_interface.h:266
vlc_value_t val
value coming from core for dialogue
Definition: vlc_interface.h:273
int i_status
Dialog status;.
Definition: vlc_interface.h:279
Arguments passed to a dialogs provider This describes the arguments passed to the dialogs provider.
Definition: vlc_interface.h:74
int i_results
Definition: vlc_interface.h:79
char * psz_title
Definition: vlc_interface.h:76
void(* pf_callback)(intf_dialog_args_t *)
Definition: vlc_interface.h:81
char ** psz_results
Definition: vlc_interface.h:78
bool b_save
Definition: vlc_interface.h:86
void * p_arg
Definition: vlc_interface.h:82
bool b_multiple
Definition: vlc_interface.h:87
struct interaction_dialog_t * p_dialog
Definition: vlc_interface.h:90
char * psz_extensions
Definition: vlc_interface.h:85
intf_thread_t * p_intf
Definition: vlc_interface.h:75
Describe all interface-specific data of the interface thread.
Definition: vlc_interface.h:51
intf_sys_t * p_sys
LibVLC interfaces book keeping.
Definition: vlc_interface.h:57
module_t * p_module
system interface
Definition: vlc_interface.h:60
config_chain_t * p_cfg
Definition: vlc_interface.h:66
void(* pf_show_dialog)(struct intf_thread_t *, int, int, intf_dialog_args_t *)
Specific for dialogs providers.
Definition: vlc_interface.h:63
struct vlc_object_t obj
Definition: vlc_interface.h:52
struct intf_thread_t * p_next
Definition: vlc_interface.h:54
Definition: vlc_objects.h:91
Internal module descriptor.
Definition: modules.h:76
Definition: vlc_messages.h:156
Mutex.
Definition: vlc_threads.h:195
VLC object common members.
Definition: vlc_objects.h:45
Definition: playlist.h:49
VLC value structure.
Definition: vlc_common.h:487
This file is a collection of common definitions and types.
Thread primitive declarations.