]> git.sesse.net Git - vlc/blob - include/main.h
e6a3327b0adadda4c9b8dc9f8e8654f08f8c042e
[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 VideoLAN
6  * $Id: main.h,v 1.45 2002/08/20 18:08:51 sam Exp $
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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 /*****************************************************************************
26  * vlc_t, p_vlc (global variable)
27  *****************************************************************************
28  * This structure has an unique instance, declared in main and pointed by the
29  * only global variable of the program. It should allow access to any variable
30  * of the program, for user-interface purposes or more easier call of interface
31  * and common functions (example: the intf_*Msg functions). Please avoid using
32  * it when you can access the members you need in an other way. In fact, it
33  * should only be used by interface thread.
34  *****************************************************************************/
35 struct vlc_t
36 {
37     VLC_COMMON_MEMBERS
38
39     /* The vlc structure status */
40     int                    i_status;
41     int                    i_instance;                   /* p_vlc instance # */
42
43     /* Global properties */
44     int                    i_argc;           /* command line arguments count */
45     char **                ppsz_argv;              /* command line arguments */
46     char *                 psz_homedir;             /* user's home directory */
47
48     u32                    i_cpu;                          /* CPU extensions */
49
50     /* Generic settings */
51     vlc_bool_t             b_quiet;                            /* be quiet ? */
52     vlc_bool_t             b_verbose;                     /* info messages ? */
53     vlc_bool_t             b_color;                      /* color messages ? */
54     mtime_t                i_desync;   /* relative desync of the audio ouput */
55
56     /* Fast memcpy plugin used */
57     module_t *             p_memcpy_module;
58     void* ( *pf_memcpy ) ( void *, const void *, size_t );
59     void* ( *pf_memset ) ( void *, int, size_t );
60
61     /* The module bank */
62     module_bank_t *        p_module_bank;
63
64     /* The message bank */
65     msg_bank_t             msg_bank;
66
67     /* Shared data - these structures are accessed directly from p_vlc by
68      * several modules */
69     input_channel_t *      p_channel;                /* channel library data */
70
71     /* Locks */
72     vlc_mutex_t            config_lock;          /* lock for the config file */
73     vlc_mutex_t            structure_lock;        /* lock for the p_vlc tree */
74
75     /* Object structure data */
76     int                    i_counter;                      /* object counter */
77     int                    i_objects;              /* Attached objects count */
78     vlc_object_t **        pp_objects;               /* Array of all objects */
79
80     /* Pointer to the big, evil global lock */
81     vlc_mutex_t *          p_global_lock;
82     void **                pp_global_data;
83
84     /* System-specific variables */
85 #if defined( SYS_BEOS )
86     vlc_object_t *         p_appthread;
87 #elif defined( WIN32 )
88     SIGNALOBJECTANDWAIT    SignalObjectAndWait;
89     vlc_bool_t             b_fast_mutex;
90     int                    i_win9x_cv;
91 #endif
92 };
93