00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef VLC_INTF_H_
00027 #define VLC_INTF_H_
00028
00029 # ifdef __cplusplus
00030 extern "C" {
00031 # endif
00032
00033 typedef struct intf_dialog_args_t intf_dialog_args_t;
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 struct intf_thread_t
00049 {
00050 VLC_COMMON_MEMBERS
00051
00052
00053 #ifdef __APPLE__
00054 bool b_should_run_on_first_thread;
00055 #endif
00056
00057
00058 intf_console_t * p_console;
00059 intf_sys_t * p_sys;
00060 char * psz_intf;
00061
00062
00063 module_t * p_module;
00064 void ( *pf_run ) ( intf_thread_t * );
00065
00066
00067 void ( *pf_show_dialog ) ( intf_thread_t *, int, int,
00068 intf_dialog_args_t * );
00069
00070
00071 bool b_interaction;
00072
00073
00074 vlc_mutex_t change_lock;
00075 bool b_menu_change;
00076 bool b_menu;
00077
00078
00079 char *psz_switch_intf;
00080 };
00081
00082
00083
00084
00085
00086 struct intf_dialog_args_t
00087 {
00088 intf_thread_t *p_intf;
00089 char *psz_title;
00090
00091 char **psz_results;
00092 int i_results;
00093
00094 void (*pf_callback) ( intf_dialog_args_t * );
00095 void *p_arg;
00096
00097
00098 char *psz_extensions;
00099 bool b_save;
00100 bool b_multiple;
00101
00102
00103 interaction_dialog_t *p_dialog;
00104 };
00105
00106
00107
00108
00109 #define intf_Create(a,b) __intf_Create(VLC_OBJECT(a),b)
00110 VLC_EXPORT( intf_thread_t *, __intf_Create, ( vlc_object_t *, const char * ) );
00111 VLC_EXPORT( int, intf_RunThread, ( intf_thread_t * ) );
00112 VLC_EXPORT( void, intf_StopThread, ( intf_thread_t * ) );
00113
00114
00115
00116 #define intf_ShouldDie( p_intf ) (p_intf->b_die || p_intf->p_libvlc->b_die )
00117
00118 #define intf_Eject(a,b) __intf_Eject(VLC_OBJECT(a),b)
00119 VLC_EXPORT( int, __intf_Eject, ( vlc_object_t *, const char * ) );
00120
00121
00122
00123
00124
00125
00126 #if defined( WIN32 ) && !defined( UNDER_CE )
00127 # define CONSOLE_INTRO_MSG \
00128 if( !getenv( "PWD" ) || !getenv( "PS1" ) ) \
00129 { \
00130 AllocConsole(); \
00131 freopen( "CONOUT$", "w", stdout ); \
00132 freopen( "CONOUT$", "w", stderr ); \
00133 freopen( "CONIN$", "r", stdin ); \
00134 } \
00135 msg_Info( p_intf, COPYRIGHT_MESSAGE ); \
00136 msg_Info( p_intf, _("\nWarning: if you can't access the GUI " \
00137 "anymore, open a command-line window, go to the " \
00138 "directory where you installed VLC and run " \
00139 "\"vlc -I qt\"\n") )
00140 #else
00141 # define CONSOLE_INTRO_MSG
00142 #endif
00143
00144
00145 typedef enum vlc_dialog {
00146 INTF_DIALOG_FILE_SIMPLE = 1,
00147 INTF_DIALOG_FILE,
00148 INTF_DIALOG_DISC,
00149 INTF_DIALOG_NET,
00150 INTF_DIALOG_CAPTURE,
00151 INTF_DIALOG_SAT,
00152 INTF_DIALOG_DIRECTORY,
00153
00154 INTF_DIALOG_STREAMWIZARD,
00155 INTF_DIALOG_WIZARD,
00156
00157 INTF_DIALOG_PLAYLIST,
00158 INTF_DIALOG_MESSAGES,
00159 INTF_DIALOG_FILEINFO,
00160 INTF_DIALOG_PREFS,
00161 INTF_DIALOG_BOOKMARKS,
00162 INTF_DIALOG_EXTENDED,
00163
00164 INTF_DIALOG_POPUPMENU = 20,
00165 INTF_DIALOG_AUDIOPOPUPMENU,
00166 INTF_DIALOG_VIDEOPOPUPMENU,
00167 INTF_DIALOG_MISCPOPUPMENU,
00168
00169 INTF_DIALOG_FILE_GENERIC = 30,
00170 INTF_DIALOG_INTERACTION = 50,
00171
00172 INTF_DIALOG_UPDATEVLC = 90,
00173 INTF_DIALOG_VLM,
00174
00175 INTF_DIALOG_EXIT = 99
00176 } vlc_dialog_t;
00177
00178
00179 #define INTF_ABOUT_MSG LICENSE_MSG
00180
00181 #define EXTENSIONS_AUDIO "*.a52;*.aac;*.ac3;*.dts;*.flac;*.m4a;*.m4p;*.mka;" \
00182 "*.mod;*.mp1;*.mp2;*.mp3;*.ogg;*.oma;*.spx;" \
00183 "*.wav;*.wma;*.xm"
00184
00185 #define EXTENSIONS_VIDEO "*.asf;*.avi;*.divx;*.dv;*.flv;*.gxf;*.m1v;*.m2v;" \
00186 "*.m2ts;*.m4v;*.mkv;*.mov;*.mp2;*.mp4;*.mpeg;*.mpeg1;" \
00187 "*.mpeg2;*.mpeg4;*.mpg;*.mts;*.mxf;*.ogg;*.ogm;" \
00188 "*.ps;*.ts;*.vob;*.wmv"
00189
00190 #define EXTENSIONS_PLAYLIST "*.asx;*.b4s;*.m3u;*.pls;*.vlc;*.xspf"
00191
00192 #define EXTENSIONS_MEDIA EXTENSIONS_VIDEO ";" EXTENSIONS_AUDIO ";" \
00193 EXTENSIONS_PLAYLIST
00194
00195 #define EXTENSIONS_SUBTITLE "*.cdg;*.idx;*.srt;*.sub;*.utf;*.ass;*.ssa;*.aqt;" \
00196 "*.jss;*.psb;*.rt;*.smi"
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207 struct interaction_dialog_t
00208 {
00209 int i_id;
00210 int i_type;
00211 char *psz_title;
00212 char *psz_description;
00213 char *psz_default_button;
00214 char *psz_alternate_button;
00215
00216 char *psz_other_button;
00217
00218 char *psz_returned[1];
00219
00220 vlc_value_t val;
00221 int i_timeToGo;
00222 bool b_cancelled;
00223
00224 void * p_private;
00225
00226 int i_status;
00227 int i_action;
00228 int i_flags;
00229 int i_return;
00230
00231 interaction_t *p_interaction;
00232 vlc_object_t *p_parent;
00233
00234 };
00235
00236
00237
00238
00239 #define DIALOG_GOT_ANSWER 0x01
00240 #define DIALOG_YES_NO_CANCEL 0x02
00241 #define DIALOG_LOGIN_PW_OK_CANCEL 0x04
00242 #define DIALOG_PSZ_INPUT_OK_CANCEL 0x08
00243 #define DIALOG_BLOCKING_ERROR 0x10
00244 #define DIALOG_NONBLOCKING_ERROR 0x20
00245 #define DIALOG_WARNING 0x40
00246 #define DIALOG_USER_PROGRESS 0x80
00247 #define DIALOG_INTF_PROGRESS 0x100
00248
00249
00250 enum
00251 {
00252 DIALOG_DEFAULT,
00253 DIALOG_OK_YES,
00254 DIALOG_NO,
00255 DIALOG_CANCELLED
00256 };
00257
00258
00259 enum
00260 {
00261 NEW_DIALOG,
00262 SENT_DIALOG,
00263 UPDATED_DIALOG,
00264 ANSWERED_DIALOG,
00265 HIDING_DIALOG,
00266 HIDDEN_DIALOG,
00267 DESTROYED_DIALOG,
00268 };
00269
00270
00271 enum
00272 {
00273 INTERACT_DIALOG_ONEWAY,
00274 INTERACT_DIALOG_TWOWAY,
00275 };
00276
00277
00278 enum
00279 {
00280 INTERACT_NEW,
00281 INTERACT_UPDATE,
00282 INTERACT_HIDE,
00283 INTERACT_DESTROY
00284 };
00285
00286
00287
00288
00289
00290 struct interaction_t
00291 {
00292 VLC_COMMON_MEMBERS
00293
00294 int i_dialogs;
00295 interaction_dialog_t **pp_dialogs;
00296 intf_thread_t *p_intf;
00297 int i_last_id;
00298 };
00299
00300
00301
00302
00303
00304 #define intf_UserFatal( a, b, c, d, e... ) __intf_UserFatal( VLC_OBJECT(a),b,c,d, ## e )
00305 VLC_EXPORT( int, __intf_UserFatal,( vlc_object_t*, bool, const char*, const char*, ...) LIBVLC_FORMAT( 4, 5 ) );
00306 #define intf_UserWarn( a, c, d, e... ) __intf_UserWarn( VLC_OBJECT(a),c,d, ## e )
00307 VLC_EXPORT( int, __intf_UserWarn,( vlc_object_t*, const char*, const char*, ...) LIBVLC_FORMAT( 3, 4 ) );
00308 #define intf_UserLoginPassword( a, b, c, d, e... ) __intf_UserLoginPassword( VLC_OBJECT(a),b,c,d,e)
00309 VLC_EXPORT( int, __intf_UserLoginPassword,( vlc_object_t*, const char*, const char*, char **, char **) );
00310 #define intf_UserYesNo( a, b, c, d, e, f ) __intf_UserYesNo( VLC_OBJECT(a),b,c, d, e, f )
00311 VLC_EXPORT( int, __intf_UserYesNo,( vlc_object_t*, const char*, const char*, const char*, const char*, const char*) );
00312 #define intf_UserStringInput( a, b, c, d ) __intf_UserStringInput( VLC_OBJECT(a),b,c,d )
00313 VLC_EXPORT( int, __intf_UserStringInput,(vlc_object_t*, const char*, const char*, char **) );
00314
00315 #define intf_IntfProgress( a, b, c ) __intf_Progress( VLC_OBJECT(a), NULL, b,c, -1 )
00316 #define intf_UserProgress( a, b, c, d, e ) __intf_Progress( VLC_OBJECT(a),b,c,d,e )
00317 VLC_EXPORT( int, __intf_Progress,( vlc_object_t*, const char*, const char*, float, int) );
00318 #define intf_ProgressUpdate( a, b, c, d, e ) __intf_ProgressUpdate( VLC_OBJECT(a),b,c,d,e )
00319 VLC_EXPORT( void, __intf_ProgressUpdate,( vlc_object_t*, int, const char*, float, int) );
00320 #define intf_ProgressIsCancelled( a, b ) __intf_UserProgressIsCancelled( VLC_OBJECT(a),b )
00321 VLC_EXPORT( bool, __intf_UserProgressIsCancelled,( vlc_object_t*, int ) );
00322 #define intf_UserHide( a, b ) __intf_UserHide( VLC_OBJECT(a), b )
00323 VLC_EXPORT( void, __intf_UserHide,( vlc_object_t *, int ));
00324
00325
00326
00327
00328 # ifdef __cplusplus
00329 }
00330 # endif
00331 #endif