main.h 3.92 KB
Newer Older
1
/*****************************************************************************
Vincent Seguin's avatar
Vincent Seguin committed
2
3
 * main.h: access to all program variables
 * Declaration and extern access to global program object.
4
 *****************************************************************************
5
 * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
6
 * $Id: main.h,v 1.39 2002/06/27 19:05:17 sam Exp $
7
 *
8
 * Authors: Vincent Seguin <seguin@via.ecp.fr>
9
10
11
12
13
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
14
 * 
15
16
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
19
 *
20
21
22
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23
 *****************************************************************************/
Vincent Seguin's avatar
Vincent Seguin committed
24

25
/*****************************************************************************
26
 * vlc_t, p_vlc (global variable)
27
 *****************************************************************************
Vincent Seguin's avatar
Vincent Seguin committed
28
29
30
31
32
33
 * This structure has an unique instance, declared in main and pointed by the
 * only global variable of the program. It should allow access to any variable
 * of the program, for user-interface purposes or more easier call of interface
 * and common functions (example: the intf_*Msg functions). Please avoid using
 * it when you can access the members you need in an other way. In fact, it
 * should only be used by interface thread.
34
 *****************************************************************************/
35
struct vlc_s
Vincent Seguin's avatar
Vincent Seguin committed
36
{
37
38
39
40
    VLC_COMMON_MEMBERS

    /* The vlc structure status */
    int                    i_status;
gbazin's avatar
   
gbazin committed
41

Vincent Seguin's avatar
Vincent Seguin committed
42
    /* Global properties */
43
44
    int                    i_argc;           /* command line arguments count */
    char **                ppsz_argv;              /* command line arguments */
gbazin's avatar
   
gbazin committed
45
    char *                 psz_homedir;             /* user's home directory */
Sam Hocevar's avatar
   
Sam Hocevar committed
46

Sam Hocevar's avatar
   
Sam Hocevar committed
47
    u32                    i_cpu_capabilities;             /* CPU extensions */
Vincent Seguin's avatar
Vincent Seguin committed
48
49

    /* Generic settings */
50
51
52
    vlc_bool_t             b_quiet;                            /* be quiet ? */
    vlc_bool_t             b_verbose;                     /* info messages ? */
    vlc_bool_t             b_color;                      /* color messages ? */
Sam Hocevar's avatar
   
Sam Hocevar committed
53
    mtime_t                i_desync;   /* relative desync of the audio ouput */
54

Sam Hocevar's avatar
   
Sam Hocevar committed
55
    /* Fast memcpy plugin used */
Sam Hocevar's avatar
   
Sam Hocevar committed
56
57
58
    module_t *             p_memcpy_module;
    void* ( *pf_memcpy ) ( void *, const void *, size_t );
    void* ( *pf_memset ) ( void *, int, size_t );    /* FIXME: unimplemented */
Sam Hocevar's avatar
   
Sam Hocevar committed
59

60
61
62
63
64
    /* The module bank */
    module_bank_t   module_bank;

    /* The message bank */
    msg_bank_t      msg_bank;
Vincent Seguin's avatar
Vincent Seguin committed
65

66
    /* Shared data - these structures are accessed directly from p_vlc by
Vincent Seguin's avatar
Vincent Seguin committed
67
     * several modules */
68
69
    intf_msg_t *           p_msg;                 /* messages interface data */
    input_channel_t *      p_channel;                /* channel library data */
gbazin's avatar
   
gbazin committed
70
71
72

    /* Locks */
    vlc_mutex_t            config_lock;          /* lock for the config file */
73
    vlc_mutex_t            structure_lock;        /* lock for the p_vlc tree */
74
    int                    i_unique;                    /* p_vlc occurence # */
75
    int                    i_counter;                      /* object counter */
Vincent Seguin's avatar
Vincent Seguin committed
76

77
78
79
80
    /* Pointer to the big, evil global lock */
    vlc_mutex_t *          p_global_lock;
    void **                pp_global_data;

81
    /* System-specific variables */
82
#if defined( SYS_BEOS )
83
    vlc_object_t *         p_appthread;
84
85
86
87
#elif defined( WIN32 )
    SIGNALOBJECTANDWAIT    SignalObjectAndWait;
    vlc_bool_t             b_fast_pthread;
#endif
88
};
Vincent Seguin's avatar
Vincent Seguin committed
89