]> git.sesse.net Git - vlc/blob - include/main.h
Qt4 - Codec Information direct access from menu.
[vlc] / include / main.h
1 /*****************************************************************************
2  * main.h: access to all program variables
3  * Declaration and extern access to global program object.
4  *****************************************************************************
5  * Copyright (C) 1999, 2000, 2001, 2002 the VideoLAN team
6  * $Id$
7  *
8  * Authors: Vincent Seguin <seguin@via.ecp.fr>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 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 General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #if !defined( __LIBVLC__ )
26   #error You are not libvlc or one of its plugins. You cannot include this file
27 #endif
28
29 /*****************************************************************************
30  * libvlc_global_data_t (global variable)
31  *****************************************************************************
32  * This structure has an unique instance, statically allocated in main and
33  * never accessed from the outside. It stores once-initialized data such as
34  * the CPU capabilities or the global lock.
35  *****************************************************************************/
36 struct libvlc_global_data_t
37 {
38     VLC_COMMON_MEMBERS
39
40     vlc_bool_t             b_ready;     ///< Initialization boolean
41     uint32_t               i_cpu;       ///< CPU extensions
42
43    /* Object structure data */
44     int                    i_counter;   ///< object counter
45     int                    i_objects;   ///< Attached objects count
46     vlc_object_t **        pp_objects;  ///< Array of all objects 
47
48     module_bank_t *        p_module_bank; ///< The module bank
49     intf_thread_t         *p_probe;       ///< Devices prober
50
51     /* Arch-specific variables */
52 #if !defined( WIN32 )
53     vlc_bool_t             b_daemon;
54 #endif
55 #if defined( SYS_BEOS )
56     vlc_object_t *         p_appthread;
57     char *                 psz_vlcpath;
58 #elif defined( __APPLE__ )
59     char *                 psz_vlcpath;
60     vlc_iconv_t            iconv_macosx; /* for HFS+ file names */
61     vlc_mutex_t            iconv_lock;
62 #elif defined( WIN32 ) && !defined( UNDER_CE )
63     SIGNALOBJECTANDWAIT    SignalObjectAndWait;
64     vlc_bool_t             b_fast_mutex;
65     int                    i_win9x_cv;
66     char *                 psz_vlcpath;
67 #elif defined( UNDER_CE )
68     char *                 psz_vlcpath;
69 #endif
70 };
71
72 /*****************************************************************************
73  * libvlc_internal_instance_t
74  *****************************************************************************
75  * This structure is a LibVLC instance, for use by libvlc core and plugins
76  *****************************************************************************/
77 struct libvlc_int_t
78 {
79     VLC_COMMON_MEMBERS
80
81     /* Global properties */
82     int                    i_argc;           ///< command line arguments count
83     char **                ppsz_argv;        ///< command line arguments
84     char *                 psz_homedir;      ///< configuration directory
85     char *                 psz_userdir;      ///< user's home directory
86     char *                 psz_configfile;   ///< location of config file
87
88     playlist_t            *p_playlist;       ///< playlist object
89
90     /* Messages */
91     msg_bank_t             msg_bank;    ///< The message bank
92     int                    i_verbose;   ///< info messages
93     vlc_bool_t             b_color;     ///< color messages?
94
95     module_t *             p_memcpy_module;  ///< Fast memcpy plugin used
96     void* ( *pf_memcpy ) ( void *, const void *, size_t ); ///< fast memcpy 
97     void* ( *pf_memset ) ( void *, int, size_t );          ///< fast memset
98
99     vlc_bool_t             b_stats;       ///< Should we collect stats ?
100     vlc_mutex_t            timer_lock;    ///< Lock to protect timers
101     int                    i_timers;      ///< Number of timers
102     counter_t            **pp_timers;     ///< Array of all timers
103
104     vlc_mutex_t            config_lock;    ///< Lock for the config file
105 #ifdef __APPLE__
106     vlc_mutex_t            quicktime_lock; ///< QT is not thread safe on OSX
107 #endif
108
109     /* Structure storing the action name / key associations */
110     struct hotkey
111     {
112         const char *psz_action;
113         int i_action;
114         int i_key;
115
116         /* hotkey accounting information */
117         mtime_t i_delta_date;/*< minimum delta time between two key presses */
118         mtime_t i_last_date; /*< last date key was pressed */
119         int     i_times;     /*< n times pressed within delta date*/
120     } *p_hotkeys;
121 };
122