]> git.sesse.net Git - vlc/blob - include/main.h
914a7514c0f5f2a9639237914aacd33b457f6c91
[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 /*****************************************************************************
26  * libvlc_global_data_t (global variable)
27  *****************************************************************************
28  * This structure has an unique instance, statically allocated in main and
29  * never accessed from the outside. It stores once-initialized data such as
30  * the CPU capabilities or the global lock.
31  *****************************************************************************/
32 struct libvlc_global_data_t
33 {
34     VLC_COMMON_MEMBERS
35
36     vlc_bool_t             b_ready;     ///< Initialization boolean
37     uint32_t               i_cpu;       ///< CPU extensions
38
39    /* Object structure data */
40     int                    i_counter;   ///< object counter
41     int                    i_objects;   ///< Attached objects count
42     vlc_object_t **        pp_objects;  ///< Array of all objects 
43
44     module_bank_t *        p_module_bank; ///< The module bank
45     intf_thread_t         *p_probe;       ///< Devices prober
46
47     /* Arch-specific variables */
48 #if !defined( WIN32 )
49     vlc_bool_t             b_daemon;
50 #endif
51 #if defined( SYS_BEOS )
52     vlc_object_t *         p_appthread;
53     char *                 psz_vlcpath;
54 #elif defined( __APPLE__ )
55     char *                 psz_vlcpath;
56     vlc_iconv_t            iconv_macosx; /* for HFS+ file names */
57     vlc_mutex_t            iconv_lock;
58 #elif defined( WIN32 ) && !defined( UNDER_CE )
59     SIGNALOBJECTANDWAIT    SignalObjectAndWait;
60     vlc_bool_t             b_fast_mutex;
61     int                    i_win9x_cv;
62     char *                 psz_vlcpath;
63 #elif defined( UNDER_CE )
64     char *                 psz_vlcpath;
65 #endif
66 };
67
68 /*****************************************************************************
69  * libvlc_internal_instance_t
70  *****************************************************************************
71  * This structure is a LibVLC instance, for use by libvlc core and plugins
72  *****************************************************************************/
73 struct libvlc_int_t
74 {
75     VLC_COMMON_MEMBERS
76
77     /* Global properties */
78     int                    i_argc;           ///< command line arguments count
79     char **                ppsz_argv;        ///< command line arguments
80     char *                 psz_homedir;      ///< configuration directory
81     char *                 psz_userdir;      ///< user's home directory
82     char *                 psz_configfile;   ///< location of config file
83
84     playlist_t            *p_playlist;       ///< playlist object
85
86     /* Messages */
87     msg_bank_t             msg_bank;    ///< The message bank
88     int                    i_verbose;   ///< info messages
89     vlc_bool_t             b_color;     ///< color messages?
90
91     module_t *             p_memcpy_module;  ///< Fast memcpy plugin used
92     void* ( *pf_memcpy ) ( void *, const void *, size_t ); ///< fast memcpy 
93     void* ( *pf_memset ) ( void *, int, size_t );          ///< fast memset
94
95     vlc_bool_t             b_stats;       ///< Should we collect stats ?
96     vlc_mutex_t            timer_lock;    ///< Lock to protect timers
97     int                    i_timers;      ///< Number of timers
98     counter_t            **pp_timers;     ///< Array of all timers
99
100     vlc_mutex_t            config_lock;    ///< Lock for the config file
101 #ifdef __APPLE__
102     vlc_mutex_t            quicktime_lock; ///< QT is not thread safe on OSX
103 #endif
104
105     /* Structure storing the action name / key associations */
106     struct hotkey
107     {
108         const char *psz_action;
109         int i_action;
110         int i_key;
111
112         /* hotkey accounting information */
113         mtime_t i_delta_date;/*< minimum delta time between two key presses */
114         mtime_t i_last_date; /*< last date key was pressed */
115         int     i_times;     /*< n times pressed within delta date*/
116     } *p_hotkeys;
117 };
118