* 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.
* It includes functions allowing to declare, get or set configuration options.
*****************************************************************************
* 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>
*
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_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;
};
/*****************************************************************************
VLC_EXPORT( char *, config_GetHomeDir, ( void ) );
VLC_EXPORT( int, __config_LoadConfigFile, ( 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( void, config_Duplicate, ( module_t *, module_config_t * ) );
#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_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.
modules/gui/skins/x11/x11_window.cpp \
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/messages.cpp \
modules/gui/wxwindows/open.cpp \
* gtk2_run.cpp:
*****************************************************************************
* 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>
*
#include "../src/vlcproc.h"
#ifndef BASIC_SKINS
-#include "../src/wxdialogs.h"
+#include "../../wxwindows/wxwindows.h"
#include "share/vlc32x32.xpm" // include the icon graphic
#endif
* skin-main.cpp: skins plugin for VLC
*****************************************************************************
* 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 Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#include "vlcproc.h"
#include "skin_common.h"
#ifndef BASIC_SKINS
-#include "wxdialogs.h"
+#include "../../wxwindows/wxwindows.h"
#endif
#ifdef X11_SKINS
* vlcproc.cpp: VlcProc class
*****************************************************************************
* 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 Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#include "skin_common.h"
#ifndef BASIC_SKINS
-#include "wxdialogs.h"
+#include "../../wxwindows/wxwindows.h"
#endif
+++ /dev/null
-/*****************************************************************************
- * wxwindows.h: private wxWindows interface description
- *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxdialogs.h,v 1.2 2003/04/21 16:55:53 anil Exp $
- *
- * Authors: Gildas Bazin <gbazin@netcourrier.com>
- *
- * 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
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- *****************************************************************************/
-
-#include <wx/listctrl.h>
-#include <wx/textctrl.h>
-#include <wx/notebook.h>
-#include <wx/spinctrl.h>
-#include <wx/dnd.h>
-#include <wx/treectrl.h>
-
-class Playlist;
-class Messages;
-class FileInfo;
-
-#define SLIDER_MAX_POS 10000
-
-/*****************************************************************************
- * Classes declarations.
- *****************************************************************************/
-class Interface;
-
-/* Timer */
-class Timer: public wxTimer
-{
-public:
- /* Constructor */
- Timer( intf_thread_t *p_intf, Interface *p_main_interface );
- virtual ~Timer();
-
- virtual void Notify();
-
-private:
- intf_thread_t *p_intf;
- Interface *p_main_interface;
- int i_old_playing_status;
-};
-
-/* Main Interface */
-class Interface: public wxFrame
-{
-public:
- /* Constructor */
- Interface( intf_thread_t *p_intf );
- virtual ~Interface();
- void TogglePlayButton( int i_playing_status );
-
- wxBoxSizer *frame_sizer;
- wxStatusBar *statusbar;
-
- wxSlider *slider;
- wxWindow *slider_frame;
- wxStaticBox *slider_box;
-
- wxMenu *p_popup_menu;
-
- wxArrayString mrl_history;
-
-private:
- void CreateOurMenuBar();
- void CreateOurToolBar();
- void CreateOurSlider();
- void Open( int i_access_method );
-
- /* Event handlers (these functions should _not_ be virtual) */
- void OnExit( wxCommandEvent& event );
- void OnAbout( wxCommandEvent& event );
- void OnMessages( wxCommandEvent& event );
- void OnPlaylist( wxCommandEvent& event );
- void OnLogs( wxCommandEvent& event );
- void OnFileInfo( wxCommandEvent& event );
- void OnPreferences( wxCommandEvent& event );
-
- void OnOpenFile( wxCommandEvent& event );
- void OnOpenDisc( wxCommandEvent& event );
- void OnOpenNet( wxCommandEvent& event );
- void OnOpenSat( wxCommandEvent& event );
-
- void OnPlayStream( wxCommandEvent& event );
- void OnStopStream( wxCommandEvent& event );
- void OnSliderUpdate( wxScrollEvent& event );
- void OnPrevStream( wxCommandEvent& event );
- void OnNextStream( wxCommandEvent& event );
-
- DECLARE_EVENT_TABLE();
-
- Timer *timer;
- intf_thread_t *p_intf;
-
- wxFrame *p_prefs_dialog;
-
- int i_old_playing_status;
-};
-
-/* Open Dialog */
-class OpenDialog: public wxDialog
-{
-public:
- /* Constructor */
- OpenDialog( intf_thread_t *p_intf, Interface *p_main_interface,
- int i_access_method );
- virtual ~OpenDialog();
- void Rebuild();
- void Manage();
-
- wxString mrl;
-
-private:
- wxPanel *FilePanel( wxWindow* parent );
- wxPanel *DiscPanel( wxWindow* parent );
- wxPanel *NetPanel( wxWindow* parent );
- wxPanel *SatPanel( wxWindow* parent );
-
- void UpdateMRL( int i_access_method );
-
- /* Event handlers (these functions should _not_ be virtual) */
- void OnOk( wxCommandEvent& event );
- void OnCancel( wxCommandEvent& event );
-
- void OnPageChange( wxNotebookEvent& event );
- void OnMRLChange( wxCommandEvent& event );
-
- /* Event handlers for the file page */
- void OnFilePanelChange( wxCommandEvent& event );
- void OnFileBrowse( wxCommandEvent& event );
-
- /* Event handlers for the disc page */
- void OnDiscPanelChange( wxCommandEvent& event );
- void OnDiscTypeChange( wxCommandEvent& event );
-
- /* Event handlers for the net page */
- void OnNetPanelChange( wxCommandEvent& event );
- void OnNetTypeChange( wxCommandEvent& event );
-
- /* Event handlers for the stream output */
- void OnSoutEnable( wxCommandEvent& event );
- void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
-
- /* Event handlers for the demux dump */
- void OnDemuxDumpEnable( wxCommandEvent& event );
- void OnDemuxDumpBrowse( wxCommandEvent& event );
- void OnDemuxDumpChange( wxCommandEvent& event );
-
- DECLARE_EVENT_TABLE();
-
- intf_thread_t *p_intf;
- Interface *p_main_interface;
- int i_current_access_method;
-
- wxComboBox *mrl_combo;
-
- /* Controls for the file panel */
- wxComboBox *file_combo;
-
- /* Controls for the disc panel */
- wxRadioBox *disc_type;
- wxTextCtrl *disc_device;
- wxSpinCtrl *disc_title;
- wxSpinCtrl *disc_chapter;
-
- /* Controls for the net panel */
- wxRadioBox *net_type;
- int i_net_type;
- wxPanel *net_subpanels[4];
- wxRadioButton *net_radios[4];
- wxSpinCtrl *net_ports[4];
- wxTextCtrl *net_addrs[4];
-
- /* Controls for the stream output */
- wxButton *sout_button;
- wxCheckBox *sout_checkbox;
-
- /* Controls for the demux dump */
- wxTextCtrl *demuxdump_textctrl;
- wxButton *demuxdump_button;
- wxCheckBox *demuxdump_checkbox;
-};
-
-enum
-{
- FILE_ACCESS = 0,
- DISC_ACCESS,
- NET_ACCESS,
- SAT_ACCESS
-};
-
-/* Stream output Dialog */
-class SoutDialog: public wxDialog
-{
-public:
- /* Constructor */
- SoutDialog( intf_thread_t *p_intf, Interface *p_main_interface );
- virtual ~SoutDialog();
-
- wxString mrl;
-
-private:
- void UpdateMRL();
- wxPanel *AccessPanel( wxWindow* parent );
- wxPanel *EncapsulationPanel( wxWindow* parent );
- void ParseMRL();
-
- /* Event handlers (these functions should _not_ be virtual) */
- void OnOk( wxCommandEvent& event );
- void OnCancel( wxCommandEvent& event );
- void OnMRLChange( wxCommandEvent& event );
- void OnAccessTypeChange( wxCommandEvent& event );
-
- /* Event handlers for the file access output */
- void OnFileChange( wxCommandEvent& event );
- void OnFileBrowse( wxCommandEvent& event );
-
- /* Event handlers for the net access output */
- void OnNetChange( wxCommandEvent& event );
-
- /* Event handlers for the encapsulation panel */
- void OnEncapsulationChange( wxCommandEvent& event );
-
- DECLARE_EVENT_TABLE();
-
- intf_thread_t *p_intf;
- Interface *p_main_interface;
-
- wxComboBox *mrl_combo;
- wxPanel *access_panel;
- wxPanel *encapsulation_panel;
-
- /* Controls for the access outputs */
- wxPanel *access_subpanels[4];
- wxRadioButton *access_radios[4];
-
- int i_access_type;
-
- wxComboBox *file_combo;
- wxSpinCtrl *net_port;
- wxTextCtrl *net_addr;
-
- /* Controls for the encapsulation */
- wxRadioButton *encapsulation_radios[4];
- int i_encapsulation_type;
-
-};
-
-/* Preferences Dialog */
-class PrefsTreeCtrl;
-class PrefsDialog: public wxFrame
-{
-public:
- /* Constructor */
- PrefsDialog( intf_thread_t *p_intf, Interface *p_main_interface );
- virtual ~PrefsDialog();
-
-private:
- wxPanel *PrefsPanel( wxWindow* parent );
-
- /* Event handlers (these functions should _not_ be virtual) */
- void OnOk( wxCommandEvent& event );
- void OnCancel( wxCommandEvent& event );
- void OnSave( wxCommandEvent& event );
-
- DECLARE_EVENT_TABLE();
-
- intf_thread_t *p_intf;
- Interface *p_main_interface;
-
- PrefsTreeCtrl *prefs_tree;
-};
-
-/* Messages */
-class Messages: public wxFrame
-{
-public:
- /* Constructor */
- Messages( intf_thread_t *p_intf, Interface *_p_main_interface );
- virtual ~Messages();
- void UpdateLog();
-
-private:
- /* Event handlers (these functions should _not_ be virtual) */
- void OnClose( wxCommandEvent& event );
- void OnVerbose( wxCommandEvent& event );
-
- DECLARE_EVENT_TABLE();
-
- intf_thread_t *p_intf;
- Interface *p_main_interface;
- wxTextCtrl *textctrl;
- wxTextAttr *info_attr;
- wxTextAttr *err_attr;
- wxTextAttr *warn_attr;
- wxTextAttr *dbg_attr;
-
- vlc_bool_t b_verbose;
-};
-
-/* Playlist */
-class Playlist: public wxFrame
-{
-public:
- /* Constructor */
- Playlist( intf_thread_t *p_intf, Interface *p_main_interface );
- virtual ~Playlist();
- void Rebuild();
- void Manage();
-
-private:
- void DeleteItem( int item );
-
- /* Event handlers (these functions should _not_ be virtual) */
- void OnAddUrl( wxCommandEvent& event );
- void OnAddDirectory( wxCommandEvent& event );
- void OnClose( wxCommandEvent& event );
- void OnInvertSelection( wxCommandEvent& event );
- void OnDeleteSelection( wxCommandEvent& event );
- void OnSelectAll( wxCommandEvent& event );
- void OnActivateItem( wxListEvent& event );
- void OnKeyDown( wxListEvent& event );
-
- DECLARE_EVENT_TABLE();
-
- intf_thread_t *p_intf;
- Interface *p_main_interface;
- wxListView *listview;
- wxButton *ok_button;
-};
-
-/* File Info */
-class FileInfo: public wxFrame
-{
-public:
- /* Constructor */
- FileInfo( intf_thread_t *p_intf, Interface *p_main_interface );
- virtual ~FileInfo();
- void UpdateFileInfo();
-
-private:
- void OnClose( wxCommandEvent& event );
-
- DECLARE_EVENT_TABLE();
-
- intf_thread_t *p_intf;
- wxTreeCtrl *fileinfo_tree;
- wxTreeItemId fileinfo_root;
- wxString fileinfo_root_label;
-
-};
-
-#if !defined(__WXX11__)
-/* Drag and Drop class */
-class DragAndDrop: public wxFileDropTarget
-{
-public:
- DragAndDrop( intf_thread_t *_p_intf );
-
- virtual bool OnDropFiles( wxCoord x, wxCoord y,
- const wxArrayString& filenames );
-
-private:
- intf_thread_t *p_intf;
-};
-#endif
-
-/* Popup contextual menu */
-class PopupMenu: public wxMenu
-{
-public:
- /* Constructor */
- PopupMenu( intf_thread_t *p_intf, Interface *p_main_interface );
- virtual ~PopupMenu();
-
-private:
- /* Event handlers (these functions should _not_ be virtual) */
- void OnClose( wxCommandEvent& event );
- void OnEntrySelected( wxCommandEvent& event );
-
- wxMenu *PopupMenu::CreateDummyMenu();
- void PopupMenu::CreateMenuEntry( char *, vlc_object_t * );
- wxMenu *PopupMenu::CreateSubMenu( char *, vlc_object_t * );
-
- DECLARE_EVENT_TABLE();
-
- intf_thread_t *p_intf;
- Interface *p_main_interface;
-
- int i_item_id;
-};
-
-class PopupEvtHandler : public wxEvtHandler
-{
-public:
- PopupEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
- virtual ~PopupEvtHandler();
-
- void PopupEvtHandler::OnMenuEvent( wxCommandEvent& event );
-
-private:
-
- DECLARE_EVENT_TABLE()
-
- intf_thread_t *p_intf;
- Interface *p_main_interface;
-};
-
-class wxMenuItemExt: public wxMenuItem
-{
-public:
- /* Constructor */
- wxMenuItemExt( wxMenu* parentMenu, int id,
- const wxString& text,
- const wxString& helpString,
- wxItemKind kind,
- char *_psz_var, int _i_object_id, vlc_value_t _val ):
- wxMenuItem( parentMenu, id, text, helpString, kind )
- {
- /* Initializations */
- psz_var = _psz_var;
- i_object_id = _i_object_id;
- val = _val;
- };
-
- virtual ~wxMenuItemExt() { if( psz_var ) free( psz_var ); };
-
- char *psz_var;
- int i_object_id;
- vlc_value_t val;
-
-private:
-
-};
* win32_run.cpp:
*****************************************************************************
* 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 Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#include "../src/vlcproc.h"
#ifndef BASIC_SKINS
-#include "../src/wxdialogs.h"
+#include "../../wxwindows/wxwindows.h"
#include "share/vlc32x32.xpm" // include the graphic icon
#endif
* x11_run.cpp:
*****************************************************************************
* 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>
*
#include "../os_theme.h"
#include "../src/skin_common.h"
#include "../src/vlcproc.h"
-#include "../src/wxdialogs.h"
+#include "../../wxwindows/wxwindows.h"
// include the icon graphic
#include "share/vlc32x32.xpm"
* fileinfo.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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>
*
#if defined MODULE_NAME_IS_skins
# include "../skins/src/skin_common.h"
-# include "../skins/src/wxdialogs.h"
-#else
-# include "wxwindows.h"
#endif
+#include "wxwindows.h"
/*****************************************************************************
* Event Table.
* interface.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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>
*
TogglePlayButton( PLAYING_S );
- /* Rebuild the playlist */
- p_intf->p_sys->p_playlist_window->Rebuild();
-
vlc_object_release( p_playlist );
}
}
void Interface::OnPlaylist( wxCommandEvent& WXUNUSED(event) )
{
/* 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 )
{
- p_playlist_window->Show( ! p_playlist_window->IsShown() );
+ p_playlist_window->ShowPlaylist( ! p_playlist_window->IsShown() );
}
}
playlist_Add( p_playlist, (const char *)filenames[i].mb_str(),
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
- /* Rebuild the playlist */
- p_intf->p_sys->p_playlist_window->Rebuild();
-
vlc_object_release( p_playlist );
return TRUE;
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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 Teulière <ipkiss@via.ecp.fr>
*
#if defined MODULE_NAME_IS_skins
# include "../skins/src/skin_common.h"
-# include "../skins/src/wxdialogs.h"
-#else
-# include "wxwindows.h"
#endif
+#include "wxwindows.h"
+
/*****************************************************************************
* Event Table.
*****************************************************************************/
* open.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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>
*
#if defined MODULE_NAME_IS_skins
# include "../skins/src/skin_common.h"
-# include "../skins/src/wxdialogs.h"
-#else
-# include "wxwindows.h"
#endif
+#include "wxwindows.h"
+
#ifndef wxRB_SINGLE
# define wxRB_SINGLE 0
#endif
/*****************************************************************************
* 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 ):
- wxDialog( _p_main_interface, -1, wxU(_("Open Target")), wxDefaultPosition,
+ wxDialog( _p_parent, -1, wxU(_("Open Target")), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{
/* Initializations */
p_intf = _p_intf;
- p_main_interface = _p_main_interface;
+ p_parent = _p_parent;
SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */
void OpenDialog::OnSoutSettings( wxCommandEvent& WXUNUSED(event) )
{
/* Show/hide the open dialog */
- SoutDialog dialog( p_intf, p_main_interface );
+ SoutDialog dialog( p_intf, p_parent );
if( dialog.ShowModal() == wxID_OK )
{
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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 Teulière <ipkiss@via.ecp.fr>
*
#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.
*****************************************************************************/
enum
{
/* menu items */
- AddUrl_Event = 1,
- AddDirectory_Event,
+ AddMRL_Event = 1,
Close_Event,
+ Open_Event,
+ Save_Event,
InvertSelection_Event,
DeleteSelection_Event,
BEGIN_EVENT_TABLE(Playlist, wxFrame)
/* Menu events */
- EVT_MENU(AddUrl_Event, Playlist::OnAddUrl)
- EVT_MENU(AddDirectory_Event, Playlist::OnAddDirectory)
+ EVT_MENU(AddMRL_Event, Playlist::OnAddMRL)
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(DeleteSelection_Event, Playlist::OnDeleteSelection)
EVT_MENU(SelectAll_Event, Playlist::OnSelectAll)
EVT_LIST_KEY_DOWN(ListView_Event, Playlist::OnKeyDown)
/* 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
* clicks on (X) */
*****************************************************************************/
Playlist::Playlist( intf_thread_t *_p_intf, Interface *_p_main_interface ):
wxFrame( _p_main_interface, -1, wxU(_("Playlist")), wxDefaultPosition,
- wxSize::wxSize( 400, 500 ), wxDEFAULT_FRAME_STYLE )
+ wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{
/* Initializations */
p_intf = _p_intf;
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 );
/* Create our "Manage" menu */
wxMenu *manage_menu = new wxMenu;
- manage_menu->Append( AddUrl_Event, wxU(_("Add &Url...")) );
- manage_menu->Append( AddDirectory_Event, wxU(_("Add &Directory...")) );
+ manage_menu->Append( AddMRL_Event, wxU(_("&Add MRL...")) );
+ manage_menu->Append( Open_Event, wxU(_("&Open Playlist...")) );
+ manage_menu->Append( Save_Event, wxU(_("&Save Playlist...")) );
manage_menu->AppendSeparator();
manage_menu->Append( Close_Event, wxU(_("&Close")) );
* themselves to the size of a listview, and with a wxDefaultSize the
* playlist window is ridiculously small */
listview = new wxListView( playlist_panel, ListView_Event,
- wxDefaultPosition, wxSize( 350, 300 ),
+ wxDefaultPosition, wxSize( 355, 300 ),
wxLC_REPORT | wxSUNKEN_BORDER );
listview->InsertColumn( 0, wxU(_("Url")) );
listview->InsertColumn( 1, wxU(_("Duration")) );
listview->SetColumnWidth( 0, 250 );
listview->SetColumnWidth( 1, 100 );
- /* Create the OK button */
- ok_button = new wxButton( playlist_panel, wxID_OK, wxU(_("OK")) );
- ok_button->SetDefault();
+ /* Create the Close button */
+ wxButton *close_button = new wxButton( playlist_panel, Close_Event,
+ wxU(_("Close")) );
+ close_button->SetDefault();
/* Place everything in sizers */
- wxBoxSizer *ok_button_sizer = new wxBoxSizer( wxHORIZONTAL );
- ok_button_sizer->Add( ok_button, 0, wxALL, 5 );
- ok_button_sizer->Layout();
+ wxBoxSizer *close_button_sizer = new wxBoxSizer( wxHORIZONTAL );
+ close_button_sizer->Add( close_button, 0, wxALL, 5 );
+ close_button_sizer->Layout();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
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();
playlist_panel->SetSizerAndFit( panel_sizer );
main_sizer->Add( playlist_panel, 1, wxGROW, 0 );
SetDropTarget( new DragAndDrop( p_intf ) );
#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 */
Rebuild();
-
}
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()
vlc_object_release( p_playlist );
}
-/* Update the colour of items */
-void Playlist::Manage()
+void Playlist::ShowPlaylist( bool show )
{
+ 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 *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
return;
}
+ /* Update the colour of items */
vlc_mutex_lock( &p_playlist->object_lock );
if( p_intf->p_sys->i_playing != p_playlist->i_index )
{
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) )
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;
+}
* preferences.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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>
*
#if defined MODULE_NAME_IS_skins
# include "../skins/src/skin_common.h"
-# include "../skins/src/wxdialogs.h"
-#else
-# include "wxwindows.h"
#endif
+#include "wxwindows.h"
#ifndef wxRB_SINGLE
# define wxRB_SINGLE 0
{
Notebook_Event = wxID_HIGHEST,
MRL_Event,
- Reset_Event,
+ ResetAll_Event,
Advanced_Event,
};
EVT_BUTTON(wxID_OK, PrefsDialog::OnOk)
EVT_BUTTON(wxID_CANCEL, PrefsDialog::OnCancel)
EVT_BUTTON(wxID_SAVE, PrefsDialog::OnSave)
+ EVT_BUTTON(ResetAll_Event, PrefsDialog::OnResetAll)
/* Don't destroy the window when the user closes it */
EVT_CLOSE(PrefsDialog::OnCancel)
wxButton *cancel_button = new wxButton( panel, wxID_CANCEL,
wxU(_("Cancel")) );
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 */
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
button_sizer->Add( ok_button, 0, wxALL, 5 );
button_sizer->Add( cancel_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();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
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.
*****************************************************************************/
* streamout.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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>
*
#if defined MODULE_NAME_IS_skins
# include "../skins/src/skin_common.h"
-# include "../skins/src/wxdialogs.h"
-#else
-# include "wxwindows.h"
#endif
+#include "wxwindows.h"
#ifndef wxRB_SINGLE
# define wxRB_SINGLE 0
/*****************************************************************************
* Constructor.
*****************************************************************************/
-SoutDialog::SoutDialog( intf_thread_t *_p_intf, Interface *_p_main_interface ):
- wxDialog( _p_main_interface, -1, wxU(_("Stream output")),
+SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
+ wxDialog( _p_parent, -1, wxU(_("Stream output")),
wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{
/* Initializations */
p_intf = _p_intf;
- p_main_interface = _p_main_interface;
+ p_parent = _p_parent;
SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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>
*
p_intf->p_sys->p_messages_window->UpdateLog();
/* Update the playlist */
- p_intf->p_sys->p_playlist_window->Manage();
+ p_intf->p_sys->p_playlist_window->UpdatePlaylist();
/* Update the fileinfo windows */
p_intf->p_sys->p_fileinfo_window->UpdateFileInfo();
* wxwindows.h: private wxWindows interface description
*****************************************************************************
* 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>
*
# define wxU(ansi) ansi
#endif
+#if !defined(MODULE_NAME_IS_skins)
/*****************************************************************************
* intf_sys_t: description and status of wxwindows interface
*****************************************************************************/
/* The window labels for DVD mode */
unsigned int i_part; /* current chapter */
};
+#endif /* !defined(MODULE_NAME_IS_skins) */
/*****************************************************************************
* Prototypes
{
public:
/* Constructor */
- OpenDialog( intf_thread_t *p_intf, Interface *p_main_interface,
+ OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
int i_access_method );
virtual ~OpenDialog();
- void Rebuild();
- void Manage();
wxString mrl;
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
- Interface *p_main_interface;
+ wxWindow *p_parent;
int i_current_access_method;
wxComboBox *mrl_combo;
{
public:
/* Constructor */
- SoutDialog( intf_thread_t *p_intf, Interface *p_main_interface );
+ SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
virtual ~SoutDialog();
wxString mrl;
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
- Interface *p_main_interface;
+ wxWindow *p_parent;
wxComboBox *mrl_combo;
wxPanel *access_panel;
void OnOk( wxCommandEvent& event );
void OnCancel( wxCommandEvent& event );
void OnSave( wxCommandEvent& event );
+ void OnResetAll( wxCommandEvent& event );
DECLARE_EVENT_TABLE();
/* Constructor */
Playlist( intf_thread_t *p_intf, Interface *p_main_interface );
virtual ~Playlist();
- void Rebuild();
- void Manage();
+
+ void UpdatePlaylist();
+ void ShowPlaylist( bool show );
+
+ bool b_need_update;
+ vlc_mutex_t lock;
private:
void DeleteItem( int item );
/* Event handlers (these functions should _not_ be virtual) */
- void OnAddUrl( wxCommandEvent& event );
- void OnAddDirectory( wxCommandEvent& event );
+ void OnAddMRL( wxCommandEvent& event );
void OnClose( wxCommandEvent& event );
+ void OnOpen( wxCommandEvent& event );
+ void OnSave( wxCommandEvent& event );
void OnInvertSelection( wxCommandEvent& event );
void OnDeleteSelection( wxCommandEvent& event );
void OnSelectAll( wxCommandEvent& event );
void OnActivateItem( wxListEvent& event );
void OnKeyDown( wxListEvent& event );
+ void Rebuild();
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
Interface *p_main_interface;
wxListView *listview;
- wxButton *ok_button;
+ int i_update_counter;
};
/* File Info */
* events.c: Windows DirectX video output events handler
*****************************************************************************
* 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>
*
void DirectXEventThread( event_thread_t *p_event )
{
MSG msg;
- POINT old_mouse_pos;
+ POINT old_mouse_pos = {0,0};
vlc_value_t val;
int i_width, i_height, i_x, i_y;
* configuration.c management of the modules configuration
*****************************************************************************
* 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>
*
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_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_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_orig = p_orig[i].f_value;
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].b_dirty = p_orig[i].b_dirty;
strdup( _(p_orig[i].psz_longtext) ) : NULL;
p_module->p_config[i].psz_value = p_orig[i].psz_value ?
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;
if( 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 )
{
for( i = 0; p_item->ppsz_list[i]; i++ )
}
}
+/*****************************************************************************
+ * 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.
*****************************************************************************
* playlist.c : Playlist management functions
*****************************************************************************
* 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>
*
#include "vlc_playlist.h"
#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
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++ )
{
fprintf( file , p_playlist->pp_items[i]->psz_uri );
- fprintf( file , PLAYLIST_FILE_EOL );
+ fprintf( file , "\n" );
}
fclose( file );