]> git.sesse.net Git - vlc/blob - include/main.h
Skeleton for testing libvlc
[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_t (global variable)
27  *****************************************************************************
28  * This structure has an unique instance, statically allocated in main and
29  * never accessed from the outside. It store once-initialized data such as
30  * the CPU capabilities or the global lock.
31  *****************************************************************************/
32 struct libvlc_t
33 {
34     VLC_COMMON_MEMBERS
35
36     /* Initialization boolean */
37     vlc_bool_t             b_ready;
38
39     /* CPU extensions */
40     uint32_t               i_cpu;
41
42     /* Generic settings */
43     int                    i_verbose;                       /* info messages */
44     vlc_bool_t             b_color;                       /* color messages? */
45
46     /* Object structure data */
47     int                    i_counter;                      /* object counter */
48     int                    i_objects;              /* Attached objects count */
49     vlc_object_t **        pp_objects;               /* Array of all objects */
50
51     /* The message bank */
52     msg_bank_t             msg_bank;
53
54     /* UTF-8 conversion */
55     vlc_mutex_t            from_locale_lock;
56     vlc_mutex_t            to_locale_lock;
57     vlc_iconv_t            from_locale;
58     vlc_iconv_t            to_locale;
59
60     /* The module bank */
61     module_bank_t *        p_module_bank;
62
63     /* Do stats ? - We keep this boolean to avoid unneeded lookups */
64     vlc_bool_t             b_stats;
65
66     /* Arch-specific variables */
67 #if !defined( WIN32 )
68     vlc_bool_t             b_daemon;
69 #endif
70 #if defined( SYS_BEOS )
71     vlc_object_t *         p_appthread;
72     char *                 psz_vlcpath;
73 #elif defined( SYS_DARWIN )
74     char *                 psz_vlcpath;
75     vlc_iconv_t            iconv_macosx; /* for HFS+ file names */
76     vlc_mutex_t            iconv_lock;
77 #elif defined( WIN32 ) && !defined( UNDER_CE )
78     SIGNALOBJECTANDWAIT    SignalObjectAndWait;
79     vlc_bool_t             b_fast_mutex;
80     int                    i_win9x_cv;
81     char *                 psz_vlcpath;
82 #elif defined( UNDER_CE )
83     char *                 psz_vlcpath;
84 #endif
85 };
86
87 /*****************************************************************************
88  * vlc_t, p_vlc
89  *****************************************************************************
90  * This structure is a LibVLC instance.
91  *****************************************************************************/
92 struct vlc_t
93 {
94     VLC_COMMON_MEMBERS
95
96     /* Global properties */
97     int                    i_argc;           /* command line arguments count */
98     char **                ppsz_argv;              /* command line arguments */
99     char *                 psz_homedir;           /* configuration directory */
100     char *                 psz_userdir;             /* user's home directory */
101     char *                 psz_configfile;        /* location of config file */
102
103     /* Fast memcpy plugin used */
104     module_t *             p_memcpy_module;
105     void* ( *pf_memcpy ) ( void *, const void *, size_t );
106     void* ( *pf_memset ) ( void *, int, size_t );
107
108     /* Shared data - these structures are accessed directly from p_vlc by
109      * several modules */
110
111     /* Locks */
112     vlc_mutex_t            config_lock;          /* lock for the config file */
113 #ifdef SYS_DARWIN
114     vlc_mutex_t            quicktime_lock;          /* QT is not thread safe on OSX */
115 #endif
116
117     /* Structure storing the action name / key associations */
118     struct hotkey
119     {
120         const char *psz_action;
121         int i_action;
122         int i_key;
123
124         /* hotkey accounting information */
125         mtime_t i_delta_date;/*< minimum delta time between two key presses */
126         mtime_t i_last_date; /*< last date key was pressed */
127         int     i_times;     /*< n times pressed within delta date*/
128     } *p_hotkeys;
129 };
130