Commit 0e7b380a authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/skins/*: got rid of wxdialogs.h, the skins plugin is now sharing wxwindows.h with the wxwindows plugin.
* modules/video_output/directx/events.c: fixed non-initialized variable.
* modules/gui/wxwindows/*: misc improvements to the playlist window (added an "Open MRL" menu as well as menus to load and save a playlist, we also make use of the "intf-change" playlist object variable now).
* src/playlist/playlist.c: the playlist file is opened in text mode, no win32 eol hack is needed.
* src/misc/configuration.c, include/configuration.h: new config_ResetAll() function to reset all config options to their original values (you still need to config_SaveConfigFile()).
* modules/gui/wxwindows/preferences.cpp: new "Reset All" button in the preferences panel.
parent 9d8a2d05
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* It includes functions allowing to declare, get or set configuration options. * It includes functions allowing to declare, get or set configuration options.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: configuration.h,v 1.26 2003/03/30 14:24:20 gbazin Exp $ * $Id: configuration.h,v 1.27 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -70,7 +70,12 @@ struct module_config_t ...@@ -70,7 +70,12 @@ struct module_config_t
vlc_mutex_t *p_lock; /* Lock to use when modifying the config */ vlc_mutex_t *p_lock; /* Lock to use when modifying the config */
vlc_bool_t b_dirty; /* Dirty flag to indicate a config change */ vlc_bool_t b_dirty; /* Dirty flag to indicate a config change */
vlc_bool_t b_advanced; /* Flag to indicate an advanced option */ vlc_bool_t b_advanced; /* Flag to indicate an advanced option */
/* Original option values */
char *psz_value_orig;
int i_value_orig;
float f_value_orig;
}; };
/***************************************************************************** /*****************************************************************************
...@@ -88,6 +93,8 @@ VLC_EXPORT( int, __config_LoadCmdLine, ( vlc_object_t *, int *, char *[], vl ...@@ -88,6 +93,8 @@ VLC_EXPORT( int, __config_LoadCmdLine, ( vlc_object_t *, int *, char *[], vl
VLC_EXPORT( char *, config_GetHomeDir, ( void ) ); VLC_EXPORT( char *, config_GetHomeDir, ( void ) );
VLC_EXPORT( int, __config_LoadConfigFile, ( vlc_object_t *, const char * ) ); VLC_EXPORT( int, __config_LoadConfigFile, ( vlc_object_t *, const char * ) );
VLC_EXPORT( int, __config_SaveConfigFile, ( vlc_object_t *, const char * ) ); VLC_EXPORT( int, __config_SaveConfigFile, ( vlc_object_t *, const char * ) );
VLC_EXPORT( void, __config_ResetAll, ( vlc_object_t * ) );
VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char *psz_name ) ); VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char *psz_name ) );
VLC_EXPORT( void, config_Duplicate, ( module_t *, module_config_t * ) ); VLC_EXPORT( void, config_Duplicate, ( module_t *, module_config_t * ) );
...@@ -106,6 +113,7 @@ VLC_EXPORT( void, config_UnsetCallbacks, ( module_config_t * ) ); ...@@ -106,6 +113,7 @@ VLC_EXPORT( void, config_UnsetCallbacks, ( module_config_t * ) );
#define config_LoadCmdLine(a,b,c,d) __config_LoadCmdLine(VLC_OBJECT(a),b,c,d) #define config_LoadCmdLine(a,b,c,d) __config_LoadCmdLine(VLC_OBJECT(a),b,c,d)
#define config_LoadConfigFile(a,b) __config_LoadConfigFile(VLC_OBJECT(a),b) #define config_LoadConfigFile(a,b) __config_LoadConfigFile(VLC_OBJECT(a),b)
#define config_SaveConfigFile(a,b) __config_SaveConfigFile(VLC_OBJECT(a),b) #define config_SaveConfigFile(a,b) __config_SaveConfigFile(VLC_OBJECT(a),b)
#define config_ResetAll(a) __config_ResetAll(VLC_OBJECT(a))
/***************************************************************************** /*****************************************************************************
* Macros used to build the configuration structure. * Macros used to build the configuration structure.
......
...@@ -107,7 +107,7 @@ SOURCES_skins = \ ...@@ -107,7 +107,7 @@ SOURCES_skins = \
modules/gui/skins/x11/x11_window.cpp \ modules/gui/skins/x11/x11_window.cpp \
modules/gui/skins/x11/x11_window.h \ modules/gui/skins/x11/x11_window.h \
\ \
modules/gui/skins/src/wxdialogs.h \ modules/gui/wxwindows/wxwindows.h \
modules/gui/wxwindows/fileinfo.cpp \ modules/gui/wxwindows/fileinfo.cpp \
modules/gui/wxwindows/messages.cpp \ modules/gui/wxwindows/messages.cpp \
modules/gui/wxwindows/open.cpp \ modules/gui/wxwindows/open.cpp \
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_run.cpp: * gtk2_run.cpp:
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: gtk2_run.cpp,v 1.23 2003/05/01 13:51:03 ipkiss Exp $ * $Id: gtk2_run.cpp,v 1.24 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#include "../src/vlcproc.h" #include "../src/vlcproc.h"
#ifndef BASIC_SKINS #ifndef BASIC_SKINS
#include "../src/wxdialogs.h" #include "../../wxwindows/wxwindows.h"
#include "share/vlc32x32.xpm" // include the icon graphic #include "share/vlc32x32.xpm" // include the icon graphic
#endif #endif
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* skin-main.cpp: skins plugin for VLC * skin-main.cpp: skins plugin for VLC
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: skin_main.cpp,v 1.25 2003/05/05 12:15:25 gbazin Exp $ * $Id: skin_main.cpp,v 1.26 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#include "vlcproc.h" #include "vlcproc.h"
#include "skin_common.h" #include "skin_common.h"
#ifndef BASIC_SKINS #ifndef BASIC_SKINS
#include "wxdialogs.h" #include "../../wxwindows/wxwindows.h"
#endif #endif
#ifdef X11_SKINS #ifdef X11_SKINS
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlcproc.cpp: VlcProc class * vlcproc.cpp: VlcProc class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: vlcproc.cpp,v 1.21 2003/05/05 16:29:57 gbazin Exp $ * $Id: vlcproc.cpp,v 1.22 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#include "skin_common.h" #include "skin_common.h"
#ifndef BASIC_SKINS #ifndef BASIC_SKINS
#include "wxdialogs.h" #include "../../wxwindows/wxwindows.h"
#endif #endif
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* win32_run.cpp: * win32_run.cpp:
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: win32_run.cpp,v 1.15 2003/05/05 12:15:25 gbazin Exp $ * $Id: win32_run.cpp,v 1.16 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
#include "../src/vlcproc.h" #include "../src/vlcproc.h"
#ifndef BASIC_SKINS #ifndef BASIC_SKINS
#include "../src/wxdialogs.h" #include "../../wxwindows/wxwindows.h"
#include "share/vlc32x32.xpm" // include the graphic icon #include "share/vlc32x32.xpm" // include the graphic icon
#endif #endif
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* x11_run.cpp: * x11_run.cpp:
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: x11_run.cpp,v 1.1 2003/04/28 14:32:57 asmax Exp $ * $Id: x11_run.cpp,v 1.2 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#include "../os_theme.h" #include "../os_theme.h"
#include "../src/skin_common.h" #include "../src/skin_common.h"
#include "../src/vlcproc.h" #include "../src/vlcproc.h"
#include "../src/wxdialogs.h" #include "../../wxwindows/wxwindows.h"
// include the icon graphic // include the icon graphic
#include "share/vlc32x32.xpm" #include "share/vlc32x32.xpm"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* fileinfo.cpp : wxWindows plugin for vlc * fileinfo.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: fileinfo.cpp,v 1.13 2003/05/11 13:45:21 gbazin Exp $ * $Id: fileinfo.cpp,v 1.14 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* *
...@@ -47,11 +47,9 @@ ...@@ -47,11 +47,9 @@
#if defined MODULE_NAME_IS_skins #if defined MODULE_NAME_IS_skins
# include "../skins/src/skin_common.h" # include "../skins/src/skin_common.h"
# include "../skins/src/wxdialogs.h"
#else
# include "wxwindows.h"
#endif #endif
#include "wxwindows.h"
/***************************************************************************** /*****************************************************************************
* Event Table. * Event Table.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* interface.cpp : wxWindows plugin for vlc * interface.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: interface.cpp,v 1.26 2003/05/11 15:55:51 gbazin Exp $ * $Id: interface.cpp,v 1.27 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -404,9 +404,6 @@ void Interface::Open( int i_access_method ) ...@@ -404,9 +404,6 @@ void Interface::Open( int i_access_method )
TogglePlayButton( PLAYING_S ); TogglePlayButton( PLAYING_S );
/* Rebuild the playlist */
p_intf->p_sys->p_playlist_window->Rebuild();
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
} }
...@@ -524,10 +521,10 @@ void Interface::OnAbout( wxCommandEvent& WXUNUSED(event) ) ...@@ -524,10 +521,10 @@ void Interface::OnAbout( wxCommandEvent& WXUNUSED(event) )
void Interface::OnPlaylist( wxCommandEvent& WXUNUSED(event) ) void Interface::OnPlaylist( wxCommandEvent& WXUNUSED(event) )
{ {
/* Show/hide the playlist window */ /* Show/hide the playlist window */
wxFrame *p_playlist_window = p_intf->p_sys->p_playlist_window; Playlist *p_playlist_window = p_intf->p_sys->p_playlist_window;
if( p_playlist_window ) if( p_playlist_window )
{ {
p_playlist_window->Show( ! p_playlist_window->IsShown() ); p_playlist_window->ShowPlaylist( ! p_playlist_window->IsShown() );
} }
} }
...@@ -777,9 +774,6 @@ bool DragAndDrop::OnDropFiles( wxCoord, wxCoord, ...@@ -777,9 +774,6 @@ bool DragAndDrop::OnDropFiles( wxCoord, wxCoord,
playlist_Add( p_playlist, (const char *)filenames[i].mb_str(), playlist_Add( p_playlist, (const char *)filenames[i].mb_str(),
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END ); PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* Rebuild the playlist */
p_intf->p_sys->p_playlist_window->Rebuild();
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
return TRUE; return TRUE;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.cpp : wxWindows plugin for vlc * playlist.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: messages.cpp,v 1.5 2003/05/11 13:22:23 gbazin Exp $ * $Id: messages.cpp,v 1.6 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* *
...@@ -47,11 +47,10 @@ ...@@ -47,11 +47,10 @@
#if defined MODULE_NAME_IS_skins #if defined MODULE_NAME_IS_skins
# include "../skins/src/skin_common.h" # include "../skins/src/skin_common.h"
# include "../skins/src/wxdialogs.h"
#else
# include "wxwindows.h"
#endif #endif
#include "wxwindows.h"
/***************************************************************************** /*****************************************************************************
* Event Table. * Event Table.
*****************************************************************************/ *****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* open.cpp : wxWindows plugin for vlc * open.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: open.cpp,v 1.18 2003/05/11 13:22:23 gbazin Exp $ * $Id: open.cpp,v 1.19 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -51,11 +51,10 @@ ...@@ -51,11 +51,10 @@
#if defined MODULE_NAME_IS_skins #if defined MODULE_NAME_IS_skins
# include "../skins/src/skin_common.h" # include "../skins/src/skin_common.h"
# include "../skins/src/wxdialogs.h"
#else
# include "wxwindows.h"
#endif #endif
#include "wxwindows.h"
#ifndef wxRB_SINGLE #ifndef wxRB_SINGLE
# define wxRB_SINGLE 0 # define wxRB_SINGLE 0
#endif #endif
...@@ -139,14 +138,14 @@ END_EVENT_TABLE() ...@@ -139,14 +138,14 @@ END_EVENT_TABLE()
/***************************************************************************** /*****************************************************************************
* Constructor. * Constructor.
*****************************************************************************/ *****************************************************************************/
OpenDialog::OpenDialog( intf_thread_t *_p_intf, Interface *_p_main_interface, OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
int i_access_method ): int i_access_method ):
wxDialog( _p_main_interface, -1, wxU(_("Open Target")), wxDefaultPosition, wxDialog( _p_parent, -1, wxU(_("Open Target")), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_FRAME_STYLE ) wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{ {
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
p_main_interface = _p_main_interface; p_parent = _p_parent;
SetIcon( *p_intf->p_sys->p_icon ); SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */ /* Create a panel to put everything in */
...@@ -657,7 +656,7 @@ void OpenDialog::OnSoutEnable( wxCommandEvent& event ) ...@@ -657,7 +656,7 @@ void OpenDialog::OnSoutEnable( wxCommandEvent& event )
void OpenDialog::OnSoutSettings( wxCommandEvent& WXUNUSED(event) ) void OpenDialog::OnSoutSettings( wxCommandEvent& WXUNUSED(event) )
{ {
/* Show/hide the open dialog */ /* Show/hide the open dialog */
SoutDialog dialog( p_intf, p_main_interface ); SoutDialog dialog( p_intf, p_parent );
if( dialog.ShowModal() == wxID_OK ) if( dialog.ShowModal() == wxID_OK )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.cpp : wxWindows plugin for vlc * playlist.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: playlist.cpp,v 1.8 2003/05/11 13:22:23 gbazin Exp $ * $Id: playlist.cpp,v 1.9 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* *
...@@ -47,6 +47,10 @@ ...@@ -47,6 +47,10 @@
#include "wxwindows.h" #include "wxwindows.h"
/* Callback prototype */
int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param );
/***************************************************************************** /*****************************************************************************
* Event Table. * Event Table.
*****************************************************************************/ *****************************************************************************/
...@@ -55,9 +59,10 @@ ...@@ -55,9 +59,10 @@
enum enum
{ {
/* menu items */ /* menu items */
AddUrl_Event = 1, AddMRL_Event = 1,
AddDirectory_Event,
Close_Event, Close_Event,
Open_Event,
Save_Event,
InvertSelection_Event, InvertSelection_Event,
DeleteSelection_Event, DeleteSelection_Event,
...@@ -69,9 +74,10 @@ enum ...@@ -69,9 +74,10 @@ enum
BEGIN_EVENT_TABLE(Playlist, wxFrame) BEGIN_EVENT_TABLE(Playlist, wxFrame)
/* Menu events */ /* Menu events */
EVT_MENU(AddUrl_Event, Playlist::OnAddUrl) EVT_MENU(AddMRL_Event, Playlist::OnAddMRL)
EVT_MENU(AddDirectory_Event, Playlist::OnAddDirectory)
EVT_MENU(Close_Event, Playlist::OnClose) EVT_MENU(Close_Event, Playlist::OnClose)
EVT_MENU(Open_Event, Playlist::OnOpen)
EVT_MENU(Save_Event, Playlist::OnSave)
EVT_MENU(InvertSelection_Event, Playlist::OnInvertSelection) EVT_MENU(InvertSelection_Event, Playlist::OnInvertSelection)
EVT_MENU(DeleteSelection_Event, Playlist::OnDeleteSelection) EVT_MENU(DeleteSelection_Event, Playlist::OnDeleteSelection)
EVT_MENU(SelectAll_Event, Playlist::OnSelectAll) EVT_MENU(SelectAll_Event, Playlist::OnSelectAll)
...@@ -81,7 +87,8 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame) ...@@ -81,7 +87,8 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
EVT_LIST_KEY_DOWN(ListView_Event, Playlist::OnKeyDown) EVT_LIST_KEY_DOWN(ListView_Event, Playlist::OnKeyDown)
/* Button events */ /* Button events */
EVT_BUTTON( wxID_OK, Playlist::OnClose) EVT_BUTTON( Close_Event, Playlist::OnClose)
EVT_BUTTON( Save_Event, Playlist::OnSave)
/* Special events : we don't want to destroy the window when the user /* Special events : we don't want to destroy the window when the user
* clicks on (X) */ * clicks on (X) */
...@@ -93,17 +100,21 @@ END_EVENT_TABLE() ...@@ -93,17 +100,21 @@ END_EVENT_TABLE()
*****************************************************************************/ *****************************************************************************/
Playlist::Playlist( intf_thread_t *_p_intf, Interface *_p_main_interface ): Playlist::Playlist( intf_thread_t *_p_intf, Interface *_p_main_interface ):
wxFrame( _p_main_interface, -1, wxU(_("Playlist")), wxDefaultPosition, wxFrame( _p_main_interface, -1, wxU(_("Playlist")), wxDefaultPosition,
wxSize::wxSize( 400, 500 ), wxDEFAULT_FRAME_STYLE ) wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{ {
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
p_main_interface = _p_main_interface; p_main_interface = _p_main_interface;
i_update_counter = 0;
b_need_update = VLC_FALSE;
vlc_mutex_init( p_intf, &lock );
SetIcon( *p_intf->p_sys->p_icon ); SetIcon( *p_intf->p_sys->p_icon );
/* Create our "Manage" menu */ /* Create our "Manage" menu */
wxMenu *manage_menu = new wxMenu; wxMenu *manage_menu = new wxMenu;
manage_menu->Append( AddUrl_Event, wxU(_("Add &Url...")) ); manage_menu->Append( AddMRL_Event, wxU(_("&Add MRL...")) );
manage_menu->Append( AddDirectory_Event, wxU(_("Add &Directory...")) ); manage_menu->Append( Open_Event, wxU(_("&Open Playlist...")) );
manage_menu->Append( Save_Event, wxU(_("&Save Playlist...")) );
manage_menu->AppendSeparator(); manage_menu->AppendSeparator();
manage_menu->Append( Close_Event, wxU(_("&Close")) ); manage_menu->Append( Close_Event, wxU(_("&Close")) );
...@@ -131,25 +142,26 @@ Playlist::Playlist( intf_thread_t *_p_intf, Interface *_p_main_interface ): ...@@ -131,25 +142,26 @@ Playlist::Playlist( intf_thread_t *_p_intf, Interface *_p_main_interface ):
* themselves to the size of a listview, and with a wxDefaultSize the * themselves to the size of a listview, and with a wxDefaultSize the
* playlist window is ridiculously small */ * playlist window is ridiculously small */
listview = new wxListView( playlist_panel, ListView_Event, listview = new wxListView( playlist_panel, ListView_Event,
wxDefaultPosition, wxSize( 350, 300 ), wxDefaultPosition, wxSize( 355, 300 ),
wxLC_REPORT | wxSUNKEN_BORDER ); wxLC_REPORT | wxSUNKEN_BORDER );
listview->InsertColumn( 0, wxU(_("Url")) ); listview->InsertColumn( 0, wxU(_("Url")) );
listview->InsertColumn( 1, wxU(_("Duration")) ); listview->InsertColumn( 1, wxU(_("Duration")) );
listview->SetColumnWidth( 0, 250 ); listview->SetColumnWidth( 0, 250 );
listview->SetColumnWidth( 1, 100 ); listview->SetColumnWidth( 1, 100 );
/* Create the OK button */ /* Create the Close button */
ok_button = new wxButton( playlist_panel, wxID_OK, wxU(_("OK")) ); wxButton *close_button = new wxButton( playlist_panel, Close_Event,
ok_button->SetDefault(); wxU(_("Close")) );
close_button->SetDefault();
/* Place everything in sizers */ /* Place everything in sizers */
wxBoxSizer *ok_button_sizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer *close_button_sizer = new wxBoxSizer( wxHORIZONTAL );
ok_button_sizer->Add( ok_button, 0, wxALL, 5 ); close_button_sizer->Add( close_button, 0, wxALL, 5 );
ok_button_sizer->Layout(); close_button_sizer->Layout();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
panel_sizer->Add( listview, 1, wxEXPAND | wxALL, 5 ); panel_sizer->Add( listview, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( ok_button_sizer, 0, wxALIGN_CENTRE ); panel_sizer->Add( close_button_sizer, 0, wxALIGN_CENTRE );
panel_sizer->Layout(); panel_sizer->Layout();
playlist_panel->SetSizerAndFit( panel_sizer ); playlist_panel->SetSizerAndFit( panel_sizer );
main_sizer->Add( playlist_panel, 1, wxGROW, 0 ); main_sizer->Add( playlist_panel, 1, wxGROW, 0 );
...@@ -161,13 +173,34 @@ Playlist::Playlist( intf_thread_t *_p_intf, Interface *_p_main_interface ): ...@@ -161,13 +173,34 @@ Playlist::Playlist( intf_thread_t *_p_intf, Interface *_p_main_interface ):
SetDropTarget( new DragAndDrop( p_intf ) ); SetDropTarget( new DragAndDrop( p_intf ) );
#endif #endif
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
/* We want to be noticed of playlit changes */
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, this );
vlc_object_release( p_playlist );
/* Update the playlist */ /* Update the playlist */
Rebuild(); Rebuild();
} }
Playlist::~Playlist() Playlist::~Playlist()
{ {
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
var_DelCallback( p_playlist, "intf-change", PlaylistChanged, this );
vlc_object_release( p_playlist );
} }
void Playlist::Rebuild() void Playlist::Rebuild()
...@@ -203,9 +236,33 @@ void Playlist::Rebuild() ...@@ -203,9 +236,33 @@ void Playlist::Rebuild()
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
/* Update the colour of items */ void Playlist::ShowPlaylist( bool show )
void Playlist::Manage()
{ {
if( show ) Rebuild();
Show( show );
}
void Playlist::UpdatePlaylist()
{
vlc_bool_t b_need_update = VLC_FALSE;
i_update_counter++;
/* If the playlist isn't show there's no need to update it */
if( !IsShown() ) return;
vlc_mutex_lock( &lock );
if( this->b_need_update )
{
b_need_update = VLC_TRUE;
this->b_need_update = VLC_FALSE;
}
vlc_mutex_unlock( &lock );
if( b_need_update ) Rebuild();
/* Updating the playing status every 0.5s is enough */
if( i_update_counter % 5 ) return;
playlist_t *p_playlist = playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
...@@ -214,6 +271,7 @@ void Playlist::Manage() ...@@ -214,6 +271,7 @@ void Playlist::Manage()
return; return;
} }
/* Update the colour of items */
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
if( p_intf->p_sys->i_playing != p_playlist->i_index ) if( p_intf->p_sys->i_playing != p_playlist->i_index )
{ {
...@@ -259,14 +317,70 @@ void Playlist::OnClose( wxCommandEvent& WXUNUSED(event) ) ...@@ -259,14 +317,70 @@ void Playlist::OnClose( wxCommandEvent& WXUNUSED(event) )
Hide(); Hide();
} }
void Playlist::OnAddUrl( wxCommandEvent& WXUNUSED(event) ) void Playlist::OnSave( wxCommandEvent& WXUNUSED(event) )
{
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
wxFileDialog dialog( this, wxU(_("Save playlist")),
wxT(""), wxT(""), wxT("*.*"), wxSAVE );
if( dialog.ShowModal() == wxID_OK )
{
playlist_SaveFile( p_playlist, dialog.GetPath().mb_str() );
}
vlc_object_release( p_playlist );
}
void Playlist::OnOpen( wxCommandEvent& WXUNUSED(event) )
{ {
/* TODO */ playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
wxFileDialog dialog( this, wxU(_("Open playlist")),
wxT(""), wxT(""), wxT("*.*"), wxOPEN );
if( dialog.ShowModal() == wxID_OK )
{
playlist_LoadFile( p_playlist, dialog.GetPath().mb_str() );
}
vlc_object_release( p_playlist );
} }
void Playlist::OnAddDirectory( wxCommandEvent& WXUNUSED(event) ) void Playlist::OnAddMRL( wxCommandEvent& WXUNUSED(event) )
{ {
/* TODO */ playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
/* Show/hide the open dialog */
OpenDialog dialog( p_intf, this, FILE_ACCESS );
if( dialog.ShowModal() == wxID_OK )
{
playlist_Add( p_playlist, (const char *)dialog.mrl.mb_str(),
PLAYLIST_APPEND, PLAYLIST_END );
}
vlc_object_release( p_playlist );
Rebuild();
} }
void Playlist::OnInvertSelection( wxCommandEvent& WXUNUSED(event) ) void Playlist::OnInvertSelection( wxCommandEvent& WXUNUSED(event) )
...@@ -324,3 +438,18 @@ void Playlist::OnKeyDown( wxListEvent& event ) ...@@ -324,3 +438,18 @@ void Playlist::OnKeyDown( wxListEvent& event )
OnDeleteSelection( event ); OnDeleteSelection( event );
} }
} }
/*****************************************************************************
* PlaylistChanged: callback triggered by the intf-change playlist variable
* We don't rebuild the playlist directly here because we don't want the
* caller to block for a too long time.
*****************************************************************************/
int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param )
{
Playlist *p_playlist_dialog = (Playlist *)param;
vlc_mutex_lock( &p_playlist_dialog->lock );
p_playlist_dialog->b_need_update = VLC_TRUE;
vlc_mutex_unlock( &p_playlist_dialog->lock );
return VLC_SUCCESS;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* preferences.cpp : wxWindows plugin for vlc * preferences.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: preferences.cpp,v 1.12 2003/05/11 13:22:23 gbazin Exp $ * $Id: preferences.cpp,v 1.13 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -55,11 +55,9 @@ ...@@ -55,11 +55,9 @@
#if defined MODULE_NAME_IS_skins #if defined MODULE_NAME_IS_skins
# include "../skins/src/skin_common.h" # include "../skins/src/skin_common.h"
# include "../skins/src/wxdialogs.h"
#else
# include "wxwindows.h"
#endif #endif
#include "wxwindows.h"
#ifndef wxRB_SINGLE #ifndef wxRB_SINGLE
# define wxRB_SINGLE 0 # define wxRB_SINGLE 0
...@@ -184,7 +182,7 @@ enum ...@@ -184,7 +182,7 @@ enum
{ {
Notebook_Event = wxID_HIGHEST, Notebook_Event = wxID_HIGHEST,
MRL_Event, MRL_Event,
Reset_Event, ResetAll_Event,
Advanced_Event, Advanced_Event,
}; };
...@@ -193,6 +191,7 @@ BEGIN_EVENT_TABLE(PrefsDialog, wxFrame) ...@@ -193,6 +191,7 @@ BEGIN_EVENT_TABLE(PrefsDialog, wxFrame)
EVT_BUTTON(wxID_OK, PrefsDialog::OnOk) EVT_BUTTON(wxID_OK, PrefsDialog::OnOk)
EVT_BUTTON(wxID_CANCEL, PrefsDialog::OnCancel) EVT_BUTTON(wxID_CANCEL, PrefsDialog::OnCancel)
EVT_BUTTON(wxID_SAVE, PrefsDialog::OnSave) EVT_BUTTON(wxID_SAVE, PrefsDialog::OnSave)
EVT_BUTTON(ResetAll_Event, PrefsDialog::OnResetAll)
/* Don't destroy the window when the user closes it */ /* Don't destroy the window when the user closes it */
EVT_CLOSE(PrefsDialog::OnCancel) EVT_CLOSE(PrefsDialog::OnCancel)
...@@ -251,14 +250,15 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf, Interface *_p_main_interface) ...@@ -251,14 +250,15 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf, Interface *_p_main_interface)
wxButton *cancel_button = new wxButton( panel, wxID_CANCEL, wxButton *cancel_button = new wxButton( panel, wxID_CANCEL,
wxU(_("Cancel")) ); wxU(_("Cancel")) );
wxButton *save_button = new wxButton( panel, wxID_SAVE, wxU(_("Save")) ); wxButton *save_button = new wxButton( panel, wxID_SAVE, wxU(_("Save")) );
//wxButton *reset_button = new wxButton( panel, Reset_Event, _("Reset") ); wxButton *reset_button = new wxButton( panel, ResetAll_Event,
wxU(_("Reset All")) );
/* Place everything in sizers */ /* Place everything in sizers */
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
button_sizer->Add( ok_button, 0, wxALL, 5 ); button_sizer->Add( ok_button, 0, wxALL, 5 );
button_sizer->Add( cancel_button, 0, wxALL, 5 ); button_sizer->Add( cancel_button, 0, wxALL, 5 );
button_sizer->Add( save_button, 0, wxALL, 5 ); button_sizer->Add( save_button, 0, wxALL, 5 );
//button_sizer->Add( reset_button, 0, wxALL, 5 ); button_sizer->Add( reset_button, 0, wxALL, 5 );
button_sizer->Layout(); button_sizer->Layout();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
...@@ -305,6 +305,21 @@ void PrefsDialog::OnSave( wxCommandEvent& WXUNUSED(event) ) ...@@ -305,6 +305,21 @@ void PrefsDialog::OnSave( wxCommandEvent& WXUNUSED(event) )
config_SaveConfigFile( p_intf, NULL ); config_SaveConfigFile( p_intf, NULL );
} }
void PrefsDialog::OnResetAll( wxCommandEvent& WXUNUSED(event) )
{
wxMessageDialog dlg( this,
wxU(_("Beware this will reset your VLC Media Player config file.\n"
"Are you sure you want to continue?")),
wxU(_("Reset config file")), wxYES_NO|wxNO_DEFAULT|wxCENTRE );
if ( dlg.ShowModal() == wxID_YES )
{
/* TODO: need to reset all the controls */
config_ResetAll( p_intf );
config_SaveConfigFile( p_intf, NULL );
}
}
/***************************************************************************** /*****************************************************************************
* PrefsTreeCtrl class definition. * PrefsTreeCtrl class definition.
*****************************************************************************/ *****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* streamout.cpp : wxWindows plugin for vlc * streamout.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: streamout.cpp,v 1.8 2003/05/11 13:22:23 gbazin Exp $ * $Id: streamout.cpp,v 1.9 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -51,11 +51,9 @@ ...@@ -51,11 +51,9 @@
#if defined MODULE_NAME_IS_skins #if defined MODULE_NAME_IS_skins
# include "../skins/src/skin_common.h" # include "../skins/src/skin_common.h"
# include "../skins/src/wxdialogs.h"
#else
# include "wxwindows.h"
#endif #endif
#include "wxwindows.h"
#ifndef wxRB_SINGLE #ifndef wxRB_SINGLE
# define wxRB_SINGLE 0 # define wxRB_SINGLE 0
...@@ -131,13 +129,13 @@ END_EVENT_TABLE() ...@@ -131,13 +129,13 @@ END_EVENT_TABLE()
/***************************************************************************** /*****************************************************************************
* Constructor. * Constructor.
*****************************************************************************/ *****************************************************************************/
SoutDialog::SoutDialog( intf_thread_t *_p_intf, Interface *_p_main_interface ): SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
wxDialog( _p_main_interface, -1, wxU(_("Stream output")), wxDialog( _p_parent, -1, wxU(_("Stream output")),
wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE ) wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{ {
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
p_main_interface = _p_main_interface; p_parent = _p_parent;
SetIcon( *p_intf->p_sys->p_icon ); SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */ /* Create a panel to put everything in */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* timer.cpp : wxWindows plugin for vlc * timer.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: timer.cpp,v 1.16 2003/05/11 13:22:23 gbazin Exp $ * $Id: timer.cpp,v 1.17 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -115,7 +115,7 @@ void Timer::Notify() ...@@ -115,7 +115,7 @@ void Timer::Notify()
p_intf->p_sys->p_messages_window->UpdateLog(); p_intf->p_sys->p_messages_window->UpdateLog();
/* Update the playlist */ /* Update the playlist */
p_intf->p_sys->p_playlist_window->Manage(); p_intf->p_sys->p_playlist_window->UpdatePlaylist();
/* Update the fileinfo windows */ /* Update the fileinfo windows */
p_intf->p_sys->p_fileinfo_window->UpdateFileInfo(); p_intf->p_sys->p_fileinfo_window->UpdateFileInfo();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description * wxwindows.h: private wxWindows interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.22 2003/05/11 13:22:23 gbazin Exp $ * $Id: wxwindows.h,v 1.23 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -41,6 +41,7 @@ class FileInfo; ...@@ -41,6 +41,7 @@ class FileInfo;
# define wxU(ansi) ansi # define wxU(ansi) ansi
#endif #endif
#if !defined(MODULE_NAME_IS_skins)
/***************************************************************************** /*****************************************************************************
* intf_sys_t: description and status of wxwindows interface * intf_sys_t: description and status of wxwindows interface
*****************************************************************************/ *****************************************************************************/
...@@ -89,6 +90,7 @@ struct intf_sys_t ...@@ -89,6 +90,7 @@ struct intf_sys_t
/* The window labels for DVD mode */ /* The window labels for DVD mode */
unsigned int i_part; /* current chapter */ unsigned int i_part; /* current chapter */
}; };
#endif /* !defined(MODULE_NAME_IS_skins) */
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
...@@ -190,11 +192,9 @@ class OpenDialog: public wxDialog ...@@ -190,11 +192,9 @@ class OpenDialog: public wxDialog
{ {
public: public:
/* Constructor */ /* Constructor */
OpenDialog( intf_thread_t *p_intf, Interface *p_main_interface, OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
int i_access_method ); int i_access_method );
virtual ~OpenDialog(); virtual ~OpenDialog();
void Rebuild();
void Manage();
wxString mrl; wxString mrl;
...@@ -237,7 +237,7 @@ private: ...@@ -237,7 +237,7 @@ private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
intf_thread_t *p_intf; intf_thread_t *p_intf;
Interface *p_main_interface; wxWindow *p_parent;
int i_current_access_method; int i_current_access_method;
wxComboBox *mrl_combo; wxComboBox *mrl_combo;
...@@ -282,7 +282,7 @@ class SoutDialog: public wxDialog ...@@ -282,7 +282,7 @@ class SoutDialog: public wxDialog
{ {
public: public:
/* Constructor */ /* Constructor */
SoutDialog( intf_thread_t *p_intf, Interface *p_main_interface ); SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
virtual ~SoutDialog(); virtual ~SoutDialog();
wxString mrl; wxString mrl;
...@@ -312,7 +312,7 @@ private: ...@@ -312,7 +312,7 @@ private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
intf_thread_t *p_intf; intf_thread_t *p_intf;
Interface *p_main_interface; wxWindow *p_parent;
wxComboBox *mrl_combo; wxComboBox *mrl_combo;
wxPanel *access_panel; wxPanel *access_panel;
...@@ -350,6 +350,7 @@ private: ...@@ -350,6 +350,7 @@ private:
void OnOk( wxCommandEvent& event ); void OnOk( wxCommandEvent& event );
void OnCancel( wxCommandEvent& event ); void OnCancel( wxCommandEvent& event );
void OnSave( wxCommandEvent& event ); void OnSave( wxCommandEvent& event );
void OnResetAll( wxCommandEvent& event );
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
...@@ -393,28 +394,34 @@ public: ...@@ -393,28 +394,34 @@ public:
/* Constructor */ /* Constructor */
Playlist( intf_thread_t *p_intf, Interface *p_main_interface ); Playlist( intf_thread_t *p_intf, Interface *p_main_interface );
virtual ~Playlist(); virtual ~Playlist();
void Rebuild();
void Manage(); void UpdatePlaylist();
void ShowPlaylist( bool show );
bool b_need_update;
vlc_mutex_t lock;
private: private:
void DeleteItem( int item ); void DeleteItem( int item );
/* Event handlers (these functions should _not_ be virtual) */ /* Event handlers (these functions should _not_ be virtual) */
void OnAddUrl( wxCommandEvent& event ); void OnAddMRL( wxCommandEvent& event );
void OnAddDirectory( wxCommandEvent& event );
void OnClose( wxCommandEvent& event ); void OnClose( wxCommandEvent& event );
void OnOpen( wxCommandEvent& event );
void OnSave( wxCommandEvent& event );
void OnInvertSelection( wxCommandEvent& event ); void OnInvertSelection( wxCommandEvent& event );
void OnDeleteSelection( wxCommandEvent& event ); void OnDeleteSelection( wxCommandEvent& event );
void OnSelectAll( wxCommandEvent& event ); void OnSelectAll( wxCommandEvent& event );
void OnActivateItem( wxListEvent& event ); void OnActivateItem( wxListEvent& event );
void OnKeyDown( wxListEvent& event ); void OnKeyDown( wxListEvent& event );
void Rebuild();
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
intf_thread_t *p_intf; intf_thread_t *p_intf;
Interface *p_main_interface; Interface *p_main_interface;
wxListView *listview; wxListView *listview;
wxButton *ok_button; int i_update_counter;
}; };
/* File Info */ /* File Info */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* events.c: Windows DirectX video output events handler * events.c: Windows DirectX video output events handler
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: events.c,v 1.13 2003/05/05 16:09:37 gbazin Exp $ * $Id: events.c,v 1.14 2003/05/12 17:33:19 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -62,7 +62,7 @@ static long FAR PASCAL DirectXEventProc ( HWND hwnd, UINT message, ...@@ -62,7 +62,7 @@ static long FAR PASCAL DirectXEventProc ( HWND hwnd, UINT message,
void DirectXEventThread( event_thread_t *p_event ) void DirectXEventThread( event_thread_t *p_event )
{ {
MSG msg; MSG msg;
POINT old_mouse_pos; POINT old_mouse_pos = {0,0};
vlc_value_t val; vlc_value_t val;
int i_width, i_height, i_x, i_y; int i_width, i_height, i_x, i_y;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* configuration.c management of the modules configuration * configuration.c management of the modules configuration
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: configuration.c,v 1.55 2003/05/09 00:58:25 titer Exp $ * $Id: configuration.c,v 1.56 2003/05/12 17:33:20 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -387,9 +387,11 @@ void config_Duplicate( module_t *p_module, module_config_t *p_orig ) ...@@ -387,9 +387,11 @@ void config_Duplicate( module_t *p_module, module_config_t *p_orig )
p_module->p_config[i].i_type = p_orig[i].i_type; p_module->p_config[i].i_type = p_orig[i].i_type;
p_module->p_config[i].i_short = p_orig[i].i_short; p_module->p_config[i].i_short = p_orig[i].i_short;
p_module->p_config[i].i_value = p_orig[i].i_value; p_module->p_config[i].i_value = p_orig[i].i_value;
p_module->p_config[i].i_value_orig = p_orig[i].i_value;
p_module->p_config[i].i_min = p_orig[i].i_min; p_module->p_config[i].i_min = p_orig[i].i_min;
p_module->p_config[i].i_max = p_orig[i].i_max; p_module->p_config[i].i_max = p_orig[i].i_max;
p_module->p_config[i].f_value = p_orig[i].f_value; p_module->p_config[i].f_value = p_orig[i].f_value;
p_module->p_config[i].f_value_orig = p_orig[i].f_value;
p_module->p_config[i].f_min = p_orig[i].f_min; p_module->p_config[i].f_min = p_orig[i].f_min;
p_module->p_config[i].f_max = p_orig[i].f_max; p_module->p_config[i].f_max = p_orig[i].f_max;
p_module->p_config[i].b_dirty = p_orig[i].b_dirty; p_module->p_config[i].b_dirty = p_orig[i].b_dirty;
...@@ -405,6 +407,8 @@ void config_Duplicate( module_t *p_module, module_config_t *p_orig ) ...@@ -405,6 +407,8 @@ void config_Duplicate( module_t *p_module, module_config_t *p_orig )
strdup( _(p_orig[i].psz_longtext) ) : NULL; strdup( _(p_orig[i].psz_longtext) ) : NULL;
p_module->p_config[i].psz_value = p_orig[i].psz_value ? p_module->p_config[i].psz_value = p_orig[i].psz_value ?
strdup( p_orig[i].psz_value ) : NULL; strdup( p_orig[i].psz_value ) : NULL;
p_module->p_config[i].psz_value_orig = p_orig[i].psz_value ?
strdup( p_orig[i].psz_value ) : NULL;
p_module->p_config[i].p_lock = &p_module->object_lock; p_module->p_config[i].p_lock = &p_module->object_lock;
...@@ -459,6 +463,9 @@ void config_Free( module_t *p_module ) ...@@ -459,6 +463,9 @@ void config_Free( module_t *p_module )
if( p_item->psz_value ) if( p_item->psz_value )
free( p_item->psz_value ); free( p_item->psz_value );
if( p_item->psz_value_orig )
free( p_item->psz_value_orig );
if( p_item->ppsz_list ) if( p_item->ppsz_list )
{ {
for( i = 0; p_item->ppsz_list[i]; i++ ) for( i = 0; p_item->ppsz_list[i]; i++ )
...@@ -502,6 +509,41 @@ void config_UnsetCallbacks( module_config_t *p_new ) ...@@ -502,6 +509,41 @@ void config_UnsetCallbacks( module_config_t *p_new )
} }
} }
/*****************************************************************************
* config_ResetAll: reset the configuration data for all the modules.
*****************************************************************************/
void __config_ResetAll( vlc_object_t *p_this )
{
int i_index, i;
vlc_list_t *p_list;
module_t *p_module;
/* Acquire config file lock */
vlc_mutex_lock( &p_this->p_vlc->config_lock );
p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < p_list->i_count; i_index++ )
{
p_module = (module_t *)p_list->p_values[i_index].p_object ;
if( p_module->b_submodule ) continue;
for( i = 0; p_module->p_config[i].i_type != CONFIG_HINT_END; i++ )
{
p_module->p_config[i].i_value = p_module->p_config[i].i_value_orig;
p_module->p_config[i].f_value = p_module->p_config[i].f_value_orig;
if( p_module->p_config[i].psz_value )
free( p_module->p_config[i].psz_value );
p_module->p_config[i].psz_value =
p_module->p_config[i].psz_value_orig ?
strdup( p_module->p_config[i].psz_value_orig ) : NULL;
}
}
vlc_list_release( p_list );
vlc_mutex_unlock( &p_this->p_vlc->config_lock );
}
/***************************************************************************** /*****************************************************************************
* config_LoadConfigFile: loads the configuration file. * config_LoadConfigFile: loads the configuration file.
***************************************************************************** *****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions * playlist.c : Playlist management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.34 2003/03/18 00:49:14 gbazin Exp $ * $Id: playlist.c,v 1.35 2003/05/12 17:33:20 gbazin Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -32,11 +32,6 @@ ...@@ -32,11 +32,6 @@
#include "vlc_playlist.h" #include "vlc_playlist.h"
#define PLAYLIST_FILE_HEADER_0_5 "# vlc playlist file version 0.5" #define PLAYLIST_FILE_HEADER_0_5 "# vlc playlist file version 0.5"
#ifdef WIN32
# define PLAYLIST_FILE_EOL "\r\n"
#else
# define PLAYLIST_FILE_EOL "\n"
#endif
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
...@@ -747,12 +742,12 @@ int playlist_SaveFile( playlist_t * p_playlist, const char * psz_filename ) ...@@ -747,12 +742,12 @@ int playlist_SaveFile( playlist_t * p_playlist, const char * psz_filename )
return -1; return -1;
} }
fprintf( file , PLAYLIST_FILE_HEADER_0_5 PLAYLIST_FILE_EOL ); fprintf( file , PLAYLIST_FILE_HEADER_0_5 "\n" );
for ( i = 0 ; i < p_playlist->i_size ; i++ ) for ( i = 0 ; i < p_playlist->i_size ; i++ )
{ {
fprintf( file , p_playlist->pp_items[i]->psz_uri ); fprintf( file , p_playlist->pp_items[i]->psz_uri );
fprintf( file , PLAYLIST_FILE_EOL ); fprintf( file , "\n" );
} }
fclose( file ); fclose( file );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment