]> git.sesse.net Git - vlc/blob - include/main.h
* Mandatory step for video output IV and the audio output quality
[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 VideoLAN
6  * $Id: main.h,v 1.17 2001/05/01 04:18:17 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  * main_t, p_main (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
36 typedef struct
37 {
38     /* Global properties */
39     int                    i_argc;           /* command line arguments count */
40     char **                ppsz_argv;              /* command line arguments */
41     char **                ppsz_env;                /* environment variables */
42     char *                 psz_arg0;         /* program name (whithout path) */
43
44     int                    i_cpu_capabilities;             /* CPU extensions */
45     int                    i_warning_level;        /* warning messages level */
46
47     /* Generic settings */
48     boolean_t              b_audio;             /* is audio output allowed ? */
49     boolean_t              b_video;             /* is video output allowed ? */
50     boolean_t              b_channels;    /* is channel changing supported ? */
51
52     /* Unique threads */
53     p_vout_thread_t        p_vout;                    /* video output thread */
54     p_aout_thread_t        p_aout;                    /* audio output thread */
55     p_intf_thread_t        p_intf;                  /* main interface thread */
56
57     /* Shared data - these structures are accessed directly from p_main by
58      * several modules */
59     p_playlist_t           p_playlist;                           /* playlist */
60     p_intf_msg_t           p_msg;                 /* messages interface data */
61     p_input_channel_t      p_channel;                /* channel library data */
62 } main_t;
63
64 extern main_t *p_main;
65
66 /*****************************************************************************
67  * Prototypes - these methods are used to get default values for some threads
68  * and modules.
69  *****************************************************************************/
70 int    main_GetIntVariable( char *psz_name, int i_default );
71 char * main_GetPszVariable( char *psz_name, char *psz_default );
72 void   main_PutIntVariable( char *psz_name, int i_value );
73 void   main_PutPszVariable( char *psz_name, char *psz_value );
74