VLC 4.0.0-dev
Loading...
Searching...
No Matches
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", "alac", \
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", "k3g", \
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", "qt", \
166 "rec", "rm", "rmvb", "rpl", "skm", "thp", "tod", "ts", "tts", "txd", "vob", "vp6", "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 "*.alac;" \
181 "*.amb;" \
182 "*.amr;" \
183 "*.aob;" \
184 "*.ape;" \
185 "*.au;" \
186 "*.awb;" \
187 "*.caf;" \
188 "*.dts;" \
189 "*.dsf;" \
190 "*.dff;" \
191 "*.flac;"\
192 "*.it;" \
193 "*.kar;" \
194 "*.m4a;" \
195 "*.m4b;" \
196 "*.m4p;" \
197 "*.m5p;" \
198 "*.mid;" \
199 "*.mka;" \
200 "*.mlp;" \
201 "*.mod;" \
202 "*.mpa;" \
203 "*.mp1;" \
204 "*.mp2;" \
205 "*.mp3;" \
206 "*.mpc;" \
207 "*.mpga;" \
208 "*.mus;" \
209 "*.oga;" \
210 "*.ogg;" \
211 "*.oma;" \
212 "*.opus;" \
213 "*.qcp;" \
214 "*.ra;" \
215 "*.rmi;" \
216 "*.s3m;" \
217 "*.sid;" \
218 "*.spx;" \
219 "*.tak;" \
220 "*.thd;" \
221 "*.tta;" \
222 "*.voc;" \
223 "*.vqf;" \
224 "*.w64;" \
225 "*.wav;" \
226 "*.wma;" \
227 "*.wv;" \
228 "*.xa;" \
229 "*.xm"
230
231#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;*.k3g;*.m1v;*.m2v;" \
232 "*.m2t;*.m2ts;*.m4v;*.mkv;*.mov;*.mp2;*.mp2v;*.mp4;*.mp4v;*.mpe;*.mpeg;*.mpeg1;" \
233 "*.mpeg2;*.mpeg4;*.mpg;*.mpv2;*.mts;*.mtv;*.mxf;*.mxg;*.nsv;*.nuv;" \
234 "*.ogg;*.ogm;*.ogv;*.ogx;*.ps;*.qt;" \
235 "*.rec;*.rm;*.rmvb;*.rpl;*.skm;*.thp;*.tod;*.tp;*.ts;*.tts;*.txd;*.vob;*.vp6;*.vro;*.webm;*.wm;*.wmv;*.wtv;*.xesc"
236
237#define EXTENSIONS_PLAYLIST "*.asx;*.b4s;*.cue;*.ifo;*.m3u;*.m3u8;*.pls;*.ram;*.rar;*.sdp;*.vlc;*.xspf;*.wax;*.wpl;*.wvx;*.zip;*.conf"
239#define EXTENSIONS_MEDIA EXTENSIONS_VIDEO ";" EXTENSIONS_AUDIO ";" \
240 EXTENSIONS_PLAYLIST
241
242#define EXTENSIONS_SUBTITLE "*.cdg;*.idx;*.srt;" \
243 "*.sub;*.utf;*.ass;" \
244 "*.ssa;*.aqt;" \
245 "*.jss;*.psb;" \
246 "*.rt;*.sami;*.smi;*.txt;" \
247 "*.smil;*.stl;*.usf;" \
248 "*.dks;*.pjs;*.mpl2;*.mks;" \
249 "*.vtt;*.tt;*.ttml;*.dfxp;" \
250 "*.scc"
251
252/** \defgroup interaction Interaction
253 * \ingroup interface
254 * Interaction between user and modules
255 * @{
256 */
257
258/**
259 * This structure describes a piece of interaction with the user
260 */
261typedef struct interaction_dialog_t
263 int i_type; ///< Type identifier
264 char *psz_title; ///< Title
265 char *psz_description; ///< Descriptor string
266 char *psz_default_button; ///< default button title (~OK)
267 char *psz_alternate_button;///< alternate button title (~NO)
268 /// other button title (optional,~Cancel)
269 char *psz_other_button;
271 char *psz_returned[1]; ///< returned responses from the user
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
@ 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
@ DIALOG_CANCELLED
Definition vlc_interface.h:307
@ DIALOG_NO
Definition vlc_interface.h:306
@ DIALOG_OK_YES
Definition vlc_interface.h:305
struct intf_sys_t intf_sys_t
Definition vlc_interface.h:47
vlc_intf_dialog
Definition vlc_interface.h:116
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:553
Definition vlc_configuration.h:320
This structure describes a piece of interaction with the user.
Definition vlc_interface.h:263
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:270
char * psz_description
Descriptor string.
Definition vlc_interface.h:266
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:272
vlc_object_t * p_parent
The vlc object that asked.
Definition vlc_interface.h:284
int i_type
Type identifier.
Definition vlc_interface.h:264
char * psz_alternate_button
alternate button title (~NO)
Definition vlc_interface.h:268
char * psz_title
Title.
Definition vlc_interface.h:265
void * p_private
Private interface data.
Definition vlc_interface.h:277
char * psz_default_button
default button title (~OK)
Definition vlc_interface.h:267
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:103
Internal module descriptor.
Definition modules.h:76
Definition vlc_messages.h:156
Mutex.
Definition vlc_threads.h:143
VLC object common members.
Definition vlc_objects.h:53
Definition playlist.h:55
This file is a collection of common definitions and types.
Thread primitive declarations.