00001 /***************************************************************************** 00002 * main.h: access to all program variables 00003 * Declaration and extern access to global program object. 00004 ***************************************************************************** 00005 * Copyright (C) 1999, 2000, 2001, 2002 the VideoLAN team 00006 * $Id: main.h 12428 2005-08-29 16:34:32Z massiot $ 00007 * 00008 * Authors: Vincent Seguin <[email protected]> 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 00023 *****************************************************************************/ 00024 00025 /***************************************************************************** 00026 * libvlc_t (global variable) 00027 ***************************************************************************** 00028 * This structure has an unique instance, statically allocated in main and 00029 * never accessed from the outside. It store once-initialized data such as 00030 * the CPU capabilities or the global lock. 00031 *****************************************************************************/ 00032 struct libvlc_t 00033 { 00034 VLC_COMMON_MEMBERS 00035 00036 /* Initialization boolean */ 00037 vlc_bool_t b_ready; 00038 00039 /* CPU extensions */ 00040 uint32_t i_cpu; 00041 00042 /* Generic settings */ 00043 int i_verbose; /* info messages */ 00044 vlc_bool_t b_color; /* color messages? */ 00045 00046 /* Object structure data */ 00047 int i_counter; /* object counter */ 00048 int i_objects; /* Attached objects count */ 00049 vlc_object_t ** pp_objects; /* Array of all objects */ 00050 00051 /* The message bank */ 00052 msg_bank_t msg_bank; 00053 00054 /* UTF-8 conversion */ 00055 vlc_mutex_t from_locale_lock; 00056 vlc_mutex_t to_locale_lock; 00057 vlc_iconv_t from_locale; 00058 vlc_iconv_t to_locale; 00059 00060 /* The module bank */ 00061 module_bank_t * p_module_bank; 00062 00063 /* Arch-specific variables */ 00064 #if !defined( WIN32 ) 00065 vlc_bool_t b_daemon; 00066 #endif 00067 #if defined( SYS_BEOS ) 00068 vlc_object_t * p_appthread; 00069 char * psz_vlcpath; 00070 #elif defined( SYS_DARWIN ) 00071 char * psz_vlcpath; 00072 vlc_iconv_t iconv_macosx; /* for HFS+ file names */ 00073 vlc_mutex_t iconv_lock; 00074 #elif defined( WIN32 ) && !defined( UNDER_CE ) 00075 SIGNALOBJECTANDWAIT SignalObjectAndWait; 00076 vlc_bool_t b_fast_mutex; 00077 int i_win9x_cv; 00078 char * psz_vlcpath; 00079 #elif defined( UNDER_CE ) 00080 char * psz_vlcpath; 00081 #endif 00082 }; 00083 00084 /***************************************************************************** 00085 * vlc_t, p_vlc 00086 ***************************************************************************** 00087 * This structure is a LibVLC instance. 00088 *****************************************************************************/ 00089 struct vlc_t 00090 { 00091 VLC_COMMON_MEMBERS 00092 00093 /* Global properties */ 00094 int i_argc; /* command line arguments count */ 00095 char ** ppsz_argv; /* command line arguments */ 00096 char * psz_homedir; /* configuration directory */ 00097 char * psz_userdir; /* user's home directory */ 00098 char * psz_configfile; /* location of config file */ 00099 00100 /* Fast memcpy plugin used */ 00101 module_t * p_memcpy_module; 00102 void* ( *pf_memcpy ) ( void *, const void *, size_t ); 00103 void* ( *pf_memset ) ( void *, int, size_t ); 00104 00105 /* Shared data - these structures are accessed directly from p_vlc by 00106 * several modules */ 00107 00108 /* Locks */ 00109 vlc_mutex_t config_lock; /* lock for the config file */ 00110 #ifdef SYS_DARWIN 00111 vlc_mutex_t quicktime_lock; /* QT is not thread safe on OSX */ 00112 #endif 00113 00114 /* Structure storing the action name / key associations */ 00115 struct hotkey 00116 { 00117 const char *psz_action; 00118 int i_action; 00119 int i_key; 00120 00121 /* hotkey accounting information */ 00122 mtime_t i_delta_date;/*< minimum delta time between two key presses */ 00123 mtime_t i_last_date; /*< last date key was pressed */ 00124 int i_times; /*< n times pressed within delta date*/ 00125 } *p_hotkeys; 00126 }; 00127