]> git.sesse.net Git - vlc/blob - include/vlc_interface.h
* include/vlc_config.h: removed unused config stuff.
[vlc] / include / vlc_interface.h
1 /*****************************************************************************
2  * vlc_interface.h: interface access for other threads
3  * This library provides basic functions for threads to interact with user
4  * interface, such as message output.
5  *****************************************************************************
6  * Copyright (C) 1999, 2000 VideoLAN
7  * $Id: vlc_interface.h,v 1.5 2003/08/30 13:59:15 gbazin Exp $
8  *
9  * Authors: Vincent Seguin <seguin@via.ecp.fr>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
24  *****************************************************************************/
25
26 typedef struct intf_dialog_args_t intf_dialog_args_t;
27
28 /*****************************************************************************
29  * intf_thread_t: describe an interface thread
30  *****************************************************************************
31  * This struct describes all interface-specific data of the main (interface)
32  * thread.
33  *****************************************************************************/
34 struct intf_thread_t
35 {
36     VLC_COMMON_MEMBERS
37
38     /* Thread properties and locks */
39     vlc_bool_t          b_block;
40
41     /* Specific interfaces */
42     intf_console_t *    p_console;                                /* console */
43     intf_sys_t *        p_sys;                           /* system interface */
44
45     /* Interface module */
46     module_t *   p_module;
47     void      ( *pf_run )    ( intf_thread_t * );
48
49     /* Specific for dialogs providers */
50     void ( *pf_show_dialog ) ( intf_thread_t *, int, int,
51                                intf_dialog_args_t * );
52
53     /* XXX: new message passing stuff will go here */
54     vlc_mutex_t  change_lock;
55     vlc_bool_t   b_menu_change;
56     vlc_bool_t   b_menu;
57 };
58
59 /*****************************************************************************
60  * intf_dialog_args_t: arguments structure passed to a dialogs provider.
61  *****************************************************************************
62  * This struct describes the arguments passed to the dialogs provider.
63  * For now they are only used with INTF_DIALOG_FILE_GENERIC.
64  *****************************************************************************/
65 struct intf_dialog_args_t
66 {
67     char *psz_title;
68
69     vlc_bool_t  b_blocking;
70     vlc_bool_t  b_ready;
71     vlc_mutex_t lock;
72     vlc_cond_t  wait;
73
74     char **psz_results;
75     int  i_results;
76
77     void (*pf_callback) ( intf_dialog_args_t * );
78     void *p_arg;
79
80     /* Specifically for INTF_DIALOG_FILE_GENERIC */
81     char *psz_extensions;
82     vlc_bool_t b_save;
83     vlc_bool_t b_multiple;
84 };
85
86 /*****************************************************************************
87  * Prototypes
88  *****************************************************************************/
89 #define intf_Create(a,b) __intf_Create(VLC_OBJECT(a),b)
90 VLC_EXPORT( intf_thread_t *, __intf_Create,     ( vlc_object_t *, const char * ) );
91 VLC_EXPORT( int,               intf_RunThread,  ( intf_thread_t * ) );
92 VLC_EXPORT( void,              intf_StopThread, ( intf_thread_t * ) );
93 VLC_EXPORT( void,              intf_Destroy,    ( intf_thread_t * ) );
94
95 /*****************************************************************************
96  * Macros
97  *****************************************************************************/
98 #if defined( WIN32 ) && !defined( UNDER_CE )
99 #    define CONSOLE_INTRO_MSG \
100          AllocConsole(); \
101          freopen( "CONOUT$", "w", stdout ); \
102          freopen( "CONOUT$", "w", stderr ); \
103          freopen( "CONIN$", "r", stdin ); \
104          msg_Info( p_intf, COPYRIGHT_MESSAGE ); \
105          msg_Info( p_intf, _("\nWarning: if you can't access the GUI " \
106                              "anymore, open a dos command box, go to the " \
107                              "directory where you installed VLC and run " \
108                              "\"vlc -I wxwin\"\n") )
109 #else
110 #    define CONSOLE_INTRO_MSG
111 #endif
112
113 /* Interface dialog ids for dialog providers */
114 #define INTF_DIALOG_FILE_SIMPLE 1
115 #define INTF_DIALOG_FILE        2
116 #define INTF_DIALOG_DISC        3
117 #define INTF_DIALOG_NET         4
118 #define INTF_DIALOG_SAT         5
119
120 #define INTF_DIALOG_PLAYLIST   10
121 #define INTF_DIALOG_MESSAGES   11
122 #define INTF_DIALOG_FILEINFO   12
123 #define INTF_DIALOG_PREFS      13
124
125 #define INTF_DIALOG_POPUPMENU  20
126
127 #define INTF_DIALOG_FILE_GENERIC 30
128
129 #define INTF_DIALOG_EXIT       99
130
131 /* Useful text messages shared by interfaces */
132 #define INTF_ABOUT_MSG \
133     _( "VLC is an open-source and cross-platform multimedia " \
134        "player for various audio and video formats (MPEG-1, MPEG-2, MPEG-4, " \
135        "DivX, mp3, Ogg, ...) as well as DVDs, VCDs, CD audio, and various " \
136        "streaming protocols.\n\n" \
137        "VLC is also a streaming server with transcoding capabilities " \
138        "(UDP unicast and multicast, HTTP, ...) mainly designed for " \
139        "high-bandwidth networks.\n\n"\
140        "For more information, have a look at the web site." )