Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

vlc_interface.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * vlc_interface.h: interface access for other threads
00003  * This library provides basic functions for threads to interact with user
00004  * interface, such as message output.
00005  *****************************************************************************
00006  * Copyright (C) 1999, 2000 the VideoLAN team
00007  * $Id: vlc_interface.h 11835 2005-07-24 21:03:20Z dionoea $
00008  *
00009  * Authors: Vincent Seguin <[email protected]>
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00024  *****************************************************************************/
00025 
00026 typedef struct intf_dialog_args_t intf_dialog_args_t;
00027 
00035 /*****************************************************************************
00036  * intf_thread_t: describe an interface thread
00037  *****************************************************************************
00038  * This struct describes all interface-specific data of the main (interface)
00039  * thread.
00040  *****************************************************************************/
00041 
00047 struct intf_thread_t
00048 {
00049     VLC_COMMON_MEMBERS
00050 
00051     /* Thread properties and locks */
00052     vlc_bool_t          b_block;
00053     vlc_bool_t          b_play;
00054 
00055     /* Specific interfaces */
00056     intf_console_t *    p_console;                               
00057     intf_sys_t *        p_sys;                          
00060     module_t *   p_module;
00061     void      ( *pf_run )    ( intf_thread_t * ); 
00064     void ( *pf_show_dialog ) ( intf_thread_t *, int, int,
00065                                intf_dialog_args_t * );
00066 
00068     void * ( *pf_request_window ) ( intf_thread_t *, vout_thread_t *,
00069                                     int *, int *,
00070                                     unsigned int *, unsigned int * );
00071     void   ( *pf_release_window ) ( intf_thread_t *, void * );
00072     int    ( *pf_control_window ) ( intf_thread_t *, void *, int, va_list );
00073 
00074     /* XXX: new message passing stuff will go here */
00075     vlc_mutex_t  change_lock;
00076     vlc_bool_t   b_menu_change;
00077     vlc_bool_t   b_menu;
00078 
00079     /* Provides the ability to switch an interface on the fly */
00080     char *psz_switch_intf;
00081 };
00082 
00083 /*****************************************************************************
00084  * intf_dialog_args_t: arguments structure passed to a dialogs provider.
00085  *****************************************************************************
00086  * This struct describes the arguments passed to the dialogs provider.
00087  * For now they are only used with INTF_DIALOG_FILE_GENERIC.
00088  *****************************************************************************/
00089 struct intf_dialog_args_t
00090 {
00091     char *psz_title;
00092 
00093     char **psz_results;
00094     int  i_results;
00095 
00096     void (*pf_callback) ( intf_dialog_args_t * );
00097     void *p_arg;
00098 
00099     /* Specifically for INTF_DIALOG_FILE_GENERIC */
00100     char *psz_extensions;
00101     vlc_bool_t b_save;
00102     vlc_bool_t b_multiple;
00103 };
00104 
00105 /*****************************************************************************
00106  * Prototypes
00107  *****************************************************************************/
00108 #define intf_Create(a,b) __intf_Create(VLC_OBJECT(a),b)
00109 VLC_EXPORT( intf_thread_t *, __intf_Create,     ( vlc_object_t *, const char * ) );
00110 VLC_EXPORT( int,               intf_RunThread,  ( intf_thread_t * ) );
00111 VLC_EXPORT( void,              intf_StopThread, ( intf_thread_t * ) );
00112 VLC_EXPORT( void,              intf_Destroy,    ( intf_thread_t * ) );
00113 
00116 /*****************************************************************************
00117  * Macros
00118  *****************************************************************************/
00119 #if defined( WIN32 ) && !defined( UNDER_CE )
00120 #    define CONSOLE_INTRO_MSG \
00121          if( !getenv( "PWD" ) || !getenv( "PS1" ) ) /* detect cygwin shell */ \
00122          { \
00123          AllocConsole(); \
00124          freopen( "CONOUT$", "w", stdout ); \
00125          freopen( "CONOUT$", "w", stderr ); \
00126          freopen( "CONIN$", "r", stdin ); \
00127          } \
00128          msg_Info( p_intf, COPYRIGHT_MESSAGE ); \
00129          msg_Info( p_intf, _("\nWarning: if you can't access the GUI " \
00130                              "anymore, open a dos command box, go to the " \
00131                              "directory where you installed VLC and run " \
00132                              "\"vlc -I wxwin\"\n") )
00133 #else
00134 #    define CONSOLE_INTRO_MSG
00135 #endif
00136 
00137 /* Interface dialog ids for dialog providers */
00138 #define INTF_DIALOG_FILE_SIMPLE 1
00139 #define INTF_DIALOG_FILE        2
00140 #define INTF_DIALOG_DISC        3
00141 #define INTF_DIALOG_NET         4
00142 #define INTF_DIALOG_CAPTURE     5
00143 #define INTF_DIALOG_SAT         6
00144 
00145 #define INTF_DIALOG_DIRECTORY   7
00146 
00147 #define INTF_DIALOG_STREAMWIZARD 8
00148 #define INTF_DIALOG_WIZARD 9
00149 
00150 #define INTF_DIALOG_PLAYLIST   10
00151 #define INTF_DIALOG_MESSAGES   11
00152 #define INTF_DIALOG_FILEINFO   12
00153 #define INTF_DIALOG_PREFS      13
00154 #define INTF_DIALOG_BOOKMARKS  14
00155 
00156 #define INTF_DIALOG_POPUPMENU  20
00157 
00158 #define INTF_DIALOG_FILE_GENERIC 30
00159 
00160 #define INTF_DIALOG_UPDATEVLC   90
00161 
00162 #define INTF_DIALOG_EXIT       99
00163 
00164 /* Useful text messages shared by interfaces */
00165 #define INTF_ABOUT_MSG \
00166     _( "VLC is an open-source and cross-platform multimedia " \
00167        "player for various audio and video formats (MPEG-1, MPEG-2, MPEG-4, " \
00168        "DivX, mp3, Ogg, etc.) as well as DVDs, VCDs, CD audio, and various " \
00169        "streaming protocols.\n\n" \
00170        "VLC is also a streaming server with transcoding capabilities " \
00171        "(UDP unicast and multicast, HTTP, etc.) mainly designed for " \
00172        "high-bandwidth networks.\n\n"\
00173        "For more information, have a look at the web site." )

Generated on Tue Dec 20 10:14:19 2005 for vlc-0.8.4a by  doxygen 1.4.2