main.h 3.6 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 VideoLAN
Sam Hocevar's avatar
 
Sam Hocevar committed
6
 * $Id: main.h,v 1.18 2001/05/06 04:32:02 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
/*****************************************************************************
Vincent Seguin's avatar
Vincent Seguin committed
26
 * main_t, p_main (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

Vincent Seguin's avatar
Vincent Seguin committed
36 37 38
typedef struct
{
    /* Global properties */
39 40 41
    int                    i_argc;           /* command line arguments count */
    char **                ppsz_argv;              /* command line arguments */
    char **                ppsz_env;                /* environment variables */
Sam Hocevar's avatar
Sam Hocevar committed
42
    char *                 psz_arg0;         /* program name (whithout path) */
Sam Hocevar's avatar
 
Sam Hocevar committed
43

44
    int                    i_cpu_capabilities;             /* CPU extensions */
Sam Hocevar's avatar
 
Sam Hocevar committed
45
    int                    i_warning_level;        /* warning messages level */
Vincent Seguin's avatar
Vincent Seguin committed
46 47

    /* Generic settings */
48 49
    boolean_t              b_audio;             /* is audio output allowed ? */
    boolean_t              b_video;             /* is video output allowed ? */
Henri Fallon's avatar
 
Henri Fallon committed
50
    boolean_t              b_channels;    /* is channel changing supported ? */
51

Vincent Seguin's avatar
Vincent Seguin committed
52
    /* Unique threads */
53
    p_intf_thread_t        p_intf;                  /* main interface thread */
Vincent Seguin's avatar
Vincent Seguin committed
54 55 56

    /* Shared data - these structures are accessed directly from p_main by
     * several modules */
Sam Hocevar's avatar
 
Sam Hocevar committed
57
    p_playlist_t           p_playlist;                           /* playlist */
58
    p_intf_msg_t           p_msg;                 /* messages interface data */
Henri Fallon's avatar
 
Henri Fallon committed
59
    p_input_channel_t      p_channel;                /* channel library data */
Vincent Seguin's avatar
Vincent Seguin committed
60 61 62 63
} main_t;

extern main_t *p_main;

64
/*****************************************************************************
Vincent Seguin's avatar
Vincent Seguin committed
65 66
 * Prototypes - these methods are used to get default values for some threads
 * and modules.
67
 *****************************************************************************/
Vincent Seguin's avatar
Vincent Seguin committed
68 69
int    main_GetIntVariable( char *psz_name, int i_default );
char * main_GetPszVariable( char *psz_name, char *psz_default );
70 71
void   main_PutIntVariable( char *psz_name, int i_value );
void   main_PutPszVariable( char *psz_name, char *psz_value );
72