X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Finterface.h;h=f2480169436fa359d8bc442cba1baeed7fa10401;hb=7671dda56b7cfa4cbbb7d5835fc5815fd2fd5175;hp=62d7d046b57ec11dbfb8078c3e71a018095e29ec;hpb=b9079557cb5224754886ea04d95df124552fb73d;p=vlc diff --git a/include/interface.h b/include/interface.h index 62d7d046b5..f248016943 100644 --- a/include/interface.h +++ b/include/interface.h @@ -4,14 +4,15 @@ * interface, such as message output. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN + * $Id: interface.h,v 1.40 2003/02/07 00:29:53 sam Exp $ * - * Authors: + * Authors: Vincent Seguin * * 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. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -22,90 +23,56 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -/***************************************************************************** - * Required headers: - * - * - * - * "config.h" - * "common.h" - * "mtime.h" - * "threads.h" - * "input.h" - * "video.h" - * "video_output.h" - * "audio_output.h" - * "xconsole.h" - *****************************************************************************/ - /***************************************************************************** * intf_thread_t: describe an interface thread ***************************************************************************** - * This structe describes all interface-specific data of the main (interface) + * This struct describes all interface-specific data of the main (interface) * thread. *****************************************************************************/ -typedef int ( intf_sys_create_t ) ( p_intf_thread_t p_intf ); -typedef void ( intf_sys_destroy_t ) ( p_intf_thread_t p_intf ); -typedef void ( intf_sys_manage_t ) ( p_intf_thread_t p_intf ); - - -typedef struct _keyparam -{ - int key; - int param; -} keyparm; - -typedef struct _key +struct intf_thread_t { - int received_key; - keyparm forwarded; - struct _key * next; -} intf_key; + VLC_COMMON_MEMBERS -typedef intf_key * p_intf_key; - -typedef struct intf_thread_s -{ - boolean_t b_die; /* `die' flag */ + /* Thread properties and locks */ + vlc_bool_t b_block; /* Specific interfaces */ - p_intf_console_t p_console; /* console */ - p_intf_sys_t p_sys; /* system interface */ - p_intf_key p_keys; - - /* Plugin */ - intf_sys_create_t * p_sys_create; /* create interface thread */ - intf_sys_manage_t * p_sys_manage; /* main loop */ - intf_sys_destroy_t * p_sys_destroy; /* destroy interface */ - - /* XXX: Channels array - new API */ - //p_intf_channel_t * p_channel[INTF_MAX_CHANNELS];/* channel descriptions */ - - /* Channels array - NULL if not used */ - p_intf_channel_t p_channel; /* description of channels */ + intf_console_t * p_console; /* console */ + intf_sys_t * p_sys; /* system interface */ - /* Main threads - NULL if not active */ - p_vout_thread_t p_vout; - p_input_thread_t p_input; + /* Interface module */ + module_t * p_module; + void ( *pf_run ) ( intf_thread_t * ); - /* Specific functions */ - keyparm (*p_intf_get_key)(struct intf_thread_s *p_intf, int r_key) ; - - /* Warning messages level */ - int i_warning_level; -} intf_thread_t; + /* XXX: new message passing stuff will go here */ + vlc_mutex_t change_lock; + vlc_bool_t b_menu_change; + vlc_bool_t b_menu; +}; /***************************************************************************** * Prototypes *****************************************************************************/ -intf_thread_t * intf_Create ( void ); -void intf_Run ( intf_thread_t * p_intf ); -void intf_Destroy ( intf_thread_t * p_intf ); - -int intf_SelectChannel ( intf_thread_t * p_intf, int i_channel ); -int intf_ProcessKey ( intf_thread_t * p_intf, int i_key ); - -void intf_AssignKey( intf_thread_t *p_intf, int r_key, int f_key, int param); -keyparm intf_GetKey( intf_thread_t *p_intf, int r_key); -void intf_AssignNormalKeys( intf_thread_t *p_intf); +#define intf_Create(a,b) __intf_Create(VLC_OBJECT(a),b) +VLC_EXPORT( intf_thread_t *, __intf_Create, ( vlc_object_t *, const char * ) ); +VLC_EXPORT( int, intf_RunThread, ( intf_thread_t * ) ); +VLC_EXPORT( void, intf_StopThread, ( intf_thread_t * ) ); +VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) ); +/***************************************************************************** + * Macros + *****************************************************************************/ +#if defined( WIN32 ) && !defined( UNDER_CE ) +# define CONSOLE_INTRO_MSG \ + AllocConsole(); \ + freopen( "CONOUT$", "w", stdout ); \ + freopen( "CONOUT$", "w", stderr ); \ + freopen( "CONIN$", "r", stdin ); \ + msg_Info( p_intf, COPYRIGHT_MESSAGE ); \ + msg_Info( p_intf, _("\nWarning: if you can't access the GUI " \ + "anymore, open a dos command box, go to the " \ + "directory where you installed VLC and run " \ + "\"vlc -I win32\"\n") ) +#else +# define CONSOLE_INTRO_MSG +#endif