* modules/gui/wxwindows/preferences.cpp: fixed the config options display for submodules.
* dvd.c : DVD input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: dvd.c,v 1.7 2003/05/15 22:27:36 massiot Exp $
+ * $Id: dvd.c,v 1.8 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#endif
add_shortcut( "dvdold" );
add_shortcut( "dvdsimple" );
- add_submodule();
- set_capability( "access", i );
- set_callbacks( E_(DVDOpen), E_(DVDClose) );
+ set_capability( "access", i );
+ set_callbacks( E_(DVDOpen), E_(DVDClose) );
+
add_submodule();
set_capability( "demux", 0 );
set_callbacks( E_(DVDInit), E_(DVDEnd) );
*****************************************************************************
*
* Copyright (C) 2001 VideoLAN
- * $Id: dvd.c,v 1.5 2003/03/30 18:14:35 gbazin Exp $
+ * $Id: dvd.c,v 1.6 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
vlc_module_begin();
add_usage_hint( N_("[dvdplay:][device][@[title][,[chapter][,angle]]]") );
set_description( _("DVD input with menus support") );
- add_submodule();
- set_capability( "access", 120 );
- set_callbacks( E_(OpenDVD), E_(CloseDVD) );
- add_shortcut( "dvd" );
+ set_capability( "access", 120 );
+ set_callbacks( E_(OpenDVD), E_(CloseDVD) );
+ add_shortcut( "dvd" );
add_submodule();
set_capability( "demux", 0 );
set_callbacks( E_(InitDVD), E_(EndDVD) );
* dvdread.c : DvdRead input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: dvdread.c,v 1.6 2003/03/30 18:14:35 gbazin Exp $
+ * $Id: dvdread.c,v 1.7 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
vlc_module_begin();
set_description( _("DVD input (using libdvdread)") );
- add_submodule();
- set_capability( "access", 110 );
- set_callbacks( E_(OpenDVD), E_(CloseDVD) );
+ set_capability( "access", 110 );
+ set_callbacks( E_(OpenDVD), E_(CloseDVD) );
add_submodule();
set_capability( "demux", 0 );
set_callbacks( E_(InitDVD), E_(EndDVD) );
* slp.c: SLP access plugin
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: slp.c,v 1.11 2003/05/15 22:27:36 massiot Exp $
+ * $Id: slp.c,v 1.12 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Loïc Minier <lool@videolan.org>
*
NAMINGAUTHORITY_LONGTEXT, VLC_TRUE );
add_string( "slp-filter", "", NULL, FILTER_TEXT, FILTER_LONGTEXT, VLC_TRUE );
add_string( "slp-lang", "", NULL, LANG_TEXT, LANG_LONGTEXT, VLC_TRUE );
- add_submodule();
- set_capability( "access", 0 );
- set_callbacks( Open, Close );
+ set_capability( "access", 0 );
+ set_callbacks( Open, Close );
+
add_submodule();
add_shortcut( "demux_slp" );
set_capability( "demux", 0 );
* beos.cpp : BeOS plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: BeOS.cpp,v 1.11 2003/06/03 12:06:29 titer Exp $
+ * $Id: BeOS.cpp,v 1.12 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
add_string( "beos-screenshotpath", "/boot/home/", NULL, "Screenshot Path", "", VLC_TRUE );
add_string_from_list( "beos-screenshotformat", "PNG", ppsz_screenshotformat, NULL, "Screenshot Format", "", VLC_TRUE );
set_description( _("BeOS standard API interface") );
- add_submodule();
- set_capability( "interface", 100 );
- set_callbacks( E_(OpenIntf), E_(CloseIntf) );
+ set_capability( "interface", 100 );
+ set_callbacks( E_(OpenIntf), E_(CloseIntf) );
+
add_submodule();
set_capability( "video output", 100 );
set_callbacks( E_(OpenVideo), E_(CloseVideo) );
* macosx.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
- * $Id: macosx.m,v 1.14 2003/06/06 02:48:19 hartman Exp $
+ * $Id: macosx.m,v 1.15 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
vlc_module_begin();
set_description( _("MacOS X interface, sound and video") );
- add_submodule();
- set_capability( "interface", 100 );
- set_callbacks( E_(OpenIntf), E_(CloseIntf) );
+ set_capability( "interface", 100 );
+ set_callbacks( E_(OpenIntf), E_(CloseIntf) );
add_submodule();
set_capability( "video output", 200 );
set_callbacks( E_(OpenVideo), E_(CloseVideo) );
*****************************************************************************/
vlc_module_begin();
set_description( _("QNX RTOS video and audio output") );
- add_submodule();
- set_capability( "video output", 100 );
- set_callbacks( E_(OpenVideo), E_(CloseVideo) );
+ set_capability( "video output", 100 );
+ set_callbacks( E_(OpenVideo), E_(CloseVideo) );
add_submodule();
set_capability( "audio output", 100 );
set_callbacks( E_(OpenAudio), E_(CloseAudio) );
* preferences.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: preferences.cpp,v 1.20 2003/06/16 21:55:58 gbazin Exp $
+ * $Id: preferences.cpp,v 1.21 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/*****************************************************************************
* Classes declarations.
*****************************************************************************/
+class ConfigTreeData;
class PrefsTreeCtrl : public wxTreeCtrl
{
public:
private:
/* Event handlers (these functions should _not_ be virtual) */
void OnSelectTreeItem( wxTreeEvent& event );
+ ConfigTreeData *FindModuleConfig( ConfigTreeData *config_data );
DECLARE_EVENT_TABLE()
{
public:
- ConfigTreeData() { panel = NULL; psz_section = NULL; }
+ ConfigTreeData() { b_submodule = 0; panel = NULL; psz_section = NULL; }
virtual ~ConfigTreeData() { if( panel ) delete panel; }
+ vlc_bool_t b_submodule;
+
PrefsPanel *panel;
wxBoxSizer *sizer;
int i_object_id;
/* Add the plugin to the tree */
ConfigTreeData *config_data = new ConfigTreeData;
- config_data->i_object_id = p_module->i_object_id;
+ config_data->b_submodule = p_module->b_submodule;
+ config_data->i_object_id = p_module->b_submodule ?
+ ((module_t *)p_module->p_parent)->i_object_id :
+ p_module->i_object_id;
AppendItem( capability_item, wxU(p_module->psz_object_name), -1, -1,
config_data );
}
long cookie, cookie2;
ConfigTreeData *config_data;
+ config_data = !GetSelection() ? NULL :
+ FindModuleConfig( (ConfigTreeData *)GetItemData( GetSelection() ) );
+ if( config_data )
+ {
+ config_data->panel->Hide();
+ p_sizer->Remove( config_data->panel );
+ }
+
/* Clean changes for the main module */
wxTreeItemId item = GetFirstChild( root_item, cookie );
for( size_t i_child_index = 0;
config_data = (ConfigTreeData *)GetItemData( item );
if( config_data && config_data->panel )
{
- if( item == GetSelection() )
- {
- config_data->panel->Hide();
- p_sizer->Remove( config_data->panel );
- }
-
delete config_data->panel;
config_data->panel = NULL;
-
- if( item == GetSelection() )
- {
- wxTreeEvent event;
- OnSelectTreeItem( event );
- }
}
item = GetNextChild( root_item, cookie );
if( config_data && config_data->panel )
{
- if( item2 == GetSelection() )
- {
- config_data->panel->Hide();
- p_sizer->Remove( config_data->panel );
- }
-
delete config_data->panel;
config_data->panel = NULL;
+ }
- if( item2 == GetSelection() )
- {
- wxTreeEvent event;
- OnSelectTreeItem( event );
- }
+ item2 = GetNextChild( item, cookie2 );
+ }
+
+ item = GetNextChild( plugins_item, cookie );
+ }
+
+ if( GetSelection() )
+ {
+ wxTreeEvent event;
+ OnSelectTreeItem( event );
+ }
+}
+
+ConfigTreeData *PrefsTreeCtrl::FindModuleConfig( ConfigTreeData *config_data )
+{
+ /* We need this complexity because submodules don't have their own config
+ * options. They use the parent module ones. */
+
+ if( !config_data || !config_data->b_submodule )
+ {
+ return config_data;
+ }
+
+ long cookie, cookie2;
+ ConfigTreeData *config_new;
+ wxTreeItemId item = GetFirstChild( plugins_item, cookie );
+ for( size_t i_child_index = 0;
+ i_child_index < GetChildrenCount( plugins_item, FALSE );
+ i_child_index++ )
+ {
+ wxTreeItemId item2 = GetFirstChild( item, cookie2 );
+ for( size_t i_child_index = 0;
+ i_child_index < GetChildrenCount( item, FALSE );
+ i_child_index++ )
+ {
+ config_new = (ConfigTreeData *)GetItemData( item2 );
+ if( config_new && !config_new->b_submodule &&
+ config_new->i_object_id == config_data->i_object_id )
+ {
+ return config_new;
}
item2 = GetNextChild( item, cookie2 );
item = GetNextChild( plugins_item, cookie );
}
+
+ /* Found nothing */
+ return NULL;
}
void PrefsTreeCtrl::OnSelectTreeItem( wxTreeEvent& event )
{
ConfigTreeData *config_data;
- config_data = (ConfigTreeData *)GetItemData( event.GetOldItem() );
+ config_data = FindModuleConfig( (ConfigTreeData *)GetItemData(
+ event.GetOldItem() ) );
if( config_data && config_data->panel )
{
config_data->panel->Hide();
}
/* Don't use event.GetItem() because we also send fake events */
- config_data = (ConfigTreeData *)GetItemData( GetSelection() );
+ config_data = FindModuleConfig( (ConfigTreeData *)GetItemData(
+ GetSelection() ) );
if( config_data )
{
if( !config_data->panel )
* dummy.c : dummy plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: dummy.c,v 1.7 2003/05/15 22:27:37 massiot Exp $
+ * $Id: dummy.c,v 1.8 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#endif
vlc_module_begin();
- set_description( _("dummy functions") );
+ set_description( _("dummy interface function") );
+ set_capability( "interface", 0 );
add_shortcut( "vlc" );
- add_submodule();
- set_description( _("dummy interface function") );
- set_capability( "interface", 0 );
- set_callbacks( E_(OpenIntf), NULL );
+ set_callbacks( E_(OpenIntf), NULL );
#ifdef WIN32
- add_category_hint( N_("Interface"), NULL, VLC_FALSE );
- add_bool( "dummy-quiet", 0, NULL, QUIET_TEXT, QUIET_LONGTEXT, VLC_FALSE );
+ add_category_hint( N_("Interface"), NULL, VLC_FALSE );
+ add_bool( "dummy-quiet", 0, NULL, QUIET_TEXT, QUIET_LONGTEXT, VLC_FALSE );
#endif
add_submodule();
set_description( _("dummy access function") );
* sap.c : SAP interface module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: sap.c,v 1.12 2003/06/16 15:39:11 zorglub Exp $
+ * $Id: sap.c,v 1.13 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Arnaud Schauly <gitan@via.ecp.fr>
*
# endif
#endif
+#ifdef UNDER_CE
+# define close(a) CloseHandle(a);
+#elif defined( WIN32 )
+# define close(a) closesocket(a);
+#endif
+
#include "network.h"
#define MAX_LINE_LENGTH 256
}
/* Closing socket */
-
-#ifdef UNDER_CE
- CloseHandle( socket_desc.i_handle );
-#elif defined( WIN32 )
- closesocket( socket_desc.i_handle );
-#else
close( socket_desc.i_handle );
-#endif
-
}
/********************************************************************