]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwindows/wxwindows.h
Remove playlist info accessors (as they now belong to input_item) and use vlc_input_i...
[vlc] / modules / gui / wxwindows / wxwindows.h
index d96bc58c31bd8e20793f64a38f45761cb09c1093..97c04e63d5f3b323d8f321cc461888aa677cf9db 100644 (file)
@@ -1,10 +1,10 @@
 /*****************************************************************************
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxwindows.h,v 1.72 2003/11/21 18:55:40 gbazin Exp $
+ * Copyright (C) 1999-2004 VideoLAN
+ * $Id$
  *
- * Authors: Gildas Bazin <gbazin@netcourrier.com>
+ * Authors: Gildas Bazin <gbazin@videolan.org>
  *
  * 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
 #include <wx/treectrl.h>
 #include <wx/gauge.h>
 #include <wx/accel.h>
+#include <wx/checkbox.h>
+#include <wx/wizard.h>
 #include "vlc_keys.h"
 
-DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
 
-class OpenDialog;
-class Playlist;
-class Messages;
-class FileInfo;
+/* Hmmm, work-around for newest wxWin */
+#ifdef wxStaticCastEvent
+#   undef wxStaticCastEvent
+#   define wxStaticCastEvent(type, val) ((type)(val))
+#endif
+
+DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
+DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
 
 #define SLIDER_MAX_POS 10000
 
 /* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
-#if defined( ENABLE_NLS ) && defined( HAVE_GETTEXT ) && \
-    defined( WIN32 ) && !defined( HAVE_INCLUDED_GETTEXT )
+#if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
 #if wxUSE_UNICODE
 #   define wxU(utf8) wxString(utf8, wxConvUTF8)
 #else
@@ -61,7 +65,7 @@ class FileInfo;
 #endif
 #define ISUTF8 1
 
-#else // ENABLE_NLS && HAVE_GETTEXT && WIN32 && !HAVE_INCLUDED_GETTEXT
+#else // ENABLE_NLS && ENABLE_UTF8
 #if wxUSE_UNICODE
 #   define wxU(ansi) wxString(ansi, *wxConvCurrent)
 #else
@@ -71,6 +75,14 @@ class FileInfo;
 
 #endif
 
+/* wxL2U (locale to unicode) is used to convert ansi strings to unicode
+ * strings (wchar_t) */
+#if wxUSE_UNICODE
+#   define wxL2U(ansi) wxString(ansi, *wxConvCurrent)
+#else
+#   define wxL2U(ansi) ansi
+#endif
+
 #define WRAPCOUNT 80
 
 #define OPEN_NORMAL 0
@@ -81,7 +93,10 @@ class FileInfo;
 #define MODE_AUTHOR 2
 #define MODE_TITLE 3
 
-wxArrayString SeparateEntries( wxString );
+class DialogsProvider;
+class PrefsTreeCtrl;
+class AutoBuiltPanel;
+class VideoWindow;
 
 /*****************************************************************************
  * intf_sys_t: description and status of wxwindows interface
@@ -94,6 +109,7 @@ struct intf_sys_t
 
     /* special actions */
     vlc_bool_t          b_playing;
+    vlc_bool_t          b_intf_show;                /* interface to be shown */
 
     /* The input thread */
     input_thread_t *    p_input;
@@ -116,17 +132,44 @@ struct intf_sys_t
     /* Popup menu */
     wxMenu              *p_popup_menu;
 
+    /* Hotkeys */
+    int                 i_first_hotkey_event;
+    int                 i_hotkeys;
+
+    /* Embedded vout */
+    VideoWindow         *p_video_window;
+    wxBoxSizer          *p_video_sizer;
+
+    /* Aout */
+    aout_instance_t     *p_aout;
 };
 
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
+wxArrayString SeparateEntries( wxString );
+wxWindow *VideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
+wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
+wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
+
+namespace wxvlc
+{
+class Interface;
+class OpenDialog;
+class SoutDialog;
+class SubsFileDialog;
+class Playlist;
+class Messages;
+class FileInfo;
+class StreamDialog;
+class WizardDialog;
+class ItemInfoDialog;
+class NewGroup;
+class ExportPlaylist;
 
 /*****************************************************************************
  * Classes declarations.
  *****************************************************************************/
-class Interface;
-
 /* Timer */
 class Timer: public wxTimer
 {
@@ -140,10 +183,111 @@ public:
 private:
     intf_thread_t *p_intf;
     Interface *p_main_interface;
+    vlc_bool_t b_init;
     int i_old_playing_status;
     int i_old_rate;
+    vlc_bool_t b_old_seekable;
+    vlc_bool_t b_disc_shown;
+};
+
+
+/* Extended panel */
+class ExtraPanel: public wxPanel
+{
+public:
+    /* Constructor */
+    ExtraPanel( intf_thread_t *p_intf, wxWindow *p_parent );
+    virtual ~ExtraPanel();
+
+    wxStaticBox *adjust_box;
+    wxButton *restoredefaults_button;
+    wxSlider *brightness_slider;
+    wxSlider *contrast_slider;
+    wxSlider *saturation_slider;
+    wxSlider *hue_slider;
+    wxSlider *gamma_slider;
+
+    wxStaticBox *other_box;
+    wxComboBox *ratio_combo;
+
+    char *psz_bands;
+    float f_preamp;
+    vlc_bool_t b_update;
+
+private:
+
+    wxPanel *VideoPanel( wxWindow * );
+    wxPanel *EqzPanel( wxWindow * );
+    wxPanel *AudioPanel( wxWindow * );
+
+    wxNotebook *notebook;
+
+    wxCheckBox *eq_chkbox;
+
+    wxCheckBox *eq_2p_chkbox;
+
+    wxSlider *smooth_slider;
+
+    wxSlider *preamp_slider;
+    wxStaticText * preamp_text;
+
+    int i_smooth;
+    wxWindow *p_parent;
+
+    wxSlider *band_sliders[10];
+    wxStaticText *band_texts[10];
+
+    int i_values[10];
+
+    void CheckAout();
+
+    /* Event handlers (these functions should _not_ be virtual) */
+
+    void OnEnableAdjust( wxCommandEvent& );
+    void OnEnableEqualizer( wxCommandEvent& );
+    void OnRestoreDefaults( wxCommandEvent& );
+    void OnChangeEqualizer( wxScrollEvent& );
+    void OnAdjustUpdate( wxScrollEvent& );
+    void OnRatio( wxCommandEvent& );
+    void OnFiltersInfo( wxCommandEvent& );
+    void OnSelectFilter( wxCommandEvent& );
+
+    void OnEqSmooth( wxScrollEvent& );
+    void OnPreamp( wxScrollEvent& );
+    void OnEq2Pass( wxCommandEvent& );
+    void OnEqRestore( wxCommandEvent& );
+
+    void OnHeadphone( wxCommandEvent& );
+    void OnNormvol( wxCommandEvent& );
+    void OnNormvolSlider( wxScrollEvent& );
+
+    void OnIdle( wxIdleEvent& );
+
+    DECLARE_EVENT_TABLE();
+
+    intf_thread_t *p_intf;
+    vlc_bool_t b_my_update;
 };
 
+#if 0
+/* Extended Window  */
+class ExtraWindow: public wxFrame
+{
+public:
+    /* Constructor */
+    ExtraWindow( intf_thread_t *p_intf, wxWindow *p_parent, wxPanel *panel );
+    virtual ~ExtraWindow();
+
+private:
+
+    wxPanel *panel;
+
+    DECLARE_EVENT_TABLE();
+
+    intf_thread_t *p_intf;
+};
+#endif
+
 /* Main Interface */
 class Interface: public wxFrame
 {
@@ -151,35 +295,37 @@ public:
     /* Constructor */
     Interface( intf_thread_t *p_intf );
     virtual ~Interface();
+    void Init();
     void TogglePlayButton( int i_playing_status );
+    void Update();
 
-//    wxFlexGridSizer *frame_sizer;
     wxBoxSizer  *frame_sizer;
     wxStatusBar *statusbar;
 
     wxSlider    *slider;
     wxWindow    *slider_frame;
-    wxWindow    *extra_frame;
-    wxStaticBox *slider_box;
+    wxBoxSizer  *slider_sizer;
+    wxPanel     *extra_frame;
 
-    vlc_bool_t b_extra;
+    wxPanel         *disc_frame;
+    wxBoxSizer      *disc_sizer;
+    wxBitmapButton  *disc_menu_button;
+    wxBitmapButton  *disc_prev_button;
+    wxBitmapButton  *disc_next_button;
 
-    wxStaticBox *adjust_box;
-    wxSlider *brightness_slider;
-    wxSlider *contrast_slider;
-    wxSlider *saturation_slider;
-    wxSlider *hue_slider;
+    wxFrame    *extra_window;
+
+    vlc_bool_t b_extra;
+    vlc_bool_t b_undock;
 
-    wxStaticBox *other_box;
-    wxComboBox *ratio_combo;
 
     wxGauge     *volctrl;
 
 private:
-    void UpdateAcceleratorTable();
+    void SetupHotkeys();
     void CreateOurMenuBar();
     void CreateOurToolBar();
-    void CreateOurExtraPanel();
+    void CreateOurExtendedPanel();
     void CreateOurSlider();
     void Open( int i_access_method );
 
@@ -188,13 +334,16 @@ private:
     void OnAbout( wxCommandEvent& event );
 
     void OnOpenFileSimple( wxCommandEvent& event );
+    void OnOpenDir( wxCommandEvent& event );
     void OnOpenFile( wxCommandEvent& event );
     void OnOpenDisc( wxCommandEvent& event );
     void OnOpenNet( wxCommandEvent& event );
     void OnOpenSat( wxCommandEvent& event );
-    void OnOpenV4L( wxCommandEvent& event );
-    void OnStream( wxCommandEvent& event );
-    void OnExtra( wxCommandEvent& event );
+
+    void OnExtended( wxCommandEvent& event );
+    //void OnUndock( wxCommandEvent& event );
+
+    void OnBookmarks( wxCommandEvent& event );
     void OnShowDialog( wxCommandEvent& event );
     void OnPlayStream( wxCommandEvent& event );
     void OnStopStream( wxCommandEvent& event );
@@ -204,14 +353,9 @@ private:
     void OnSlowStream( wxCommandEvent& event );
     void OnFastStream( wxCommandEvent& event );
 
-    void OnEnableAdjust( wxCommandEvent& event );
-    void OnHueUpdate( wxScrollEvent& event );
-    void OnContrastUpdate( wxScrollEvent& event );
-    void OnBrightnessUpdate( wxScrollEvent& event );
-    void OnSaturationUpdate( wxScrollEvent& event );
-
-    void OnRatio( wxCommandEvent& event );
-    void OnEnableVisual( wxCommandEvent& event );
+    void OnDiscMenu( wxCommandEvent& event );
+    void OnDiscPrev( wxCommandEvent& event );
+    void OnDiscNext( wxCommandEvent& event );
 
     void OnMenuOpen( wxMenuEvent& event );
 
@@ -220,6 +364,8 @@ private:
 #endif
     void OnContextMenu(wxMouseEvent& event);
 
+    void OnControlEvent( wxCommandEvent& event );
+
     DECLARE_EVENT_TABLE();
 
     Timer *timer;
@@ -229,73 +375,15 @@ private:
     int i_old_playing_status;
 
     /* For auto-generated menus */
+    wxMenu *p_settings_menu;
     wxMenu *p_audio_menu;
-    vlc_bool_t b_audio_menu;
     wxMenu *p_video_menu;
-    vlc_bool_t b_video_menu;
     wxMenu *p_navig_menu;
-    vlc_bool_t b_navig_menu;
-    wxMenu *p_misc_menu;
-    vlc_bool_t b_misc_menu;
-};
-
-class StreamDialog;
-
-/* Dialogs Provider */
-class DialogsProvider: public wxFrame
-{
-public:
-    /* Constructor */
-    DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
-    virtual ~DialogsProvider();
-
-private:
-    void Open( int i_access_method, int i_arg );
-
-    /* Event handlers (these functions should _not_ be virtual) */
-    void OnExit( wxCommandEvent& event );
-    void OnPlaylist( wxCommandEvent& event );
-    void OnMessages( wxCommandEvent& event );
-    void OnFileInfo( wxCommandEvent& event );
-    void OnPreferences( wxCommandEvent& event );
-    void OnStreamDialog( wxCommandEvent& event );
-
-    void OnOpenFileGeneric( wxCommandEvent& event );
-    void OnOpenFileSimple( wxCommandEvent& event );
-    void OnOpenFile( wxCommandEvent& event );
-    void OnOpenDisc( wxCommandEvent& event );
-    void OnOpenNet( wxCommandEvent& event );
-    void OnOpenSat( wxCommandEvent& event );
-
-    void OnPopupMenu( wxCommandEvent& event );
-
-    void OnIdle( wxIdleEvent& event );
-
-    void OnExitThread( wxCommandEvent& event );
-
-    DECLARE_EVENT_TABLE();
-
-    intf_thread_t *p_intf;
-
-public:
-    /* Secondary windows */
-    OpenDialog          *p_open_dialog;
-    wxFileDialog        *p_file_dialog;
-    Playlist            *p_playlist_dialog;
-    Messages            *p_messages_dialog;
-    FileInfo            *p_fileinfo_dialog;
-    StreamDialog        *p_stream_dialog;
-    wxFrame             *p_prefs_dialog;
-    wxFileDialog        *p_file_generic_dialog;
 };
 
 /* Open Dialog */
-class AutoBuiltPanel;
 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
-class V4LDialog;
-class SoutDialog;
-class SubsFileDialog;
-class OpenDialog: public wxFrame
+class OpenDialog: public wxDialog
 {
 public:
     /* Constructor */
@@ -319,7 +407,6 @@ private:
     wxPanel *FilePanel( wxWindow* parent );
     wxPanel *DiscPanel( wxWindow* parent );
     wxPanel *NetPanel( wxWindow* parent );
-    wxPanel *V4LPanel( wxWindow* parent );
 
     ArrayOfAutoBuiltPanel input_tab_array;
 
@@ -337,16 +424,12 @@ private:
     /* Event handlers for the disc page */
     void OnDiscPanelChange( wxCommandEvent& event );
     void OnDiscTypeChange( wxCommandEvent& event );
+    void OnDiscDeviceChange( wxCommandEvent& event );
 
     /* Event handlers for the net page */
     void OnNetPanelChange( wxCommandEvent& event );
     void OnNetTypeChange( wxCommandEvent& event );
 
-    /* Event handlers for the v4l page */
-    void OnV4LPanelChange( wxCommandEvent& event );
-    void OnV4LTypeChange( wxCommandEvent& event );
-    void OnV4LSettingsChange( wxCommandEvent& event );
-
     /* Event handlers for the stream output */
     void OnSubsFileEnable( wxCommandEvent& event );
     void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
@@ -355,13 +438,20 @@ private:
     void OnSoutEnable( wxCommandEvent& event );
     void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
 
+    /* Event handlers for the caching option */
+    void OnCachingEnable( wxCommandEvent& event );
+    void OnCachingChange( wxCommandEvent& event );
+
     DECLARE_EVENT_TABLE();
 
     intf_thread_t *p_intf;
     wxWindow *p_parent;
     int i_current_access_method;
+    int i_disc_type_selection;
 
     int i_method; /* Normal or for the stream dialog ? */
+    int i_open_arg;
+
     wxComboBox *mrl_combo;
     wxNotebook *notebook;
 
@@ -372,11 +462,19 @@ private:
     /* Controls for the disc panel */
     wxRadioBox *disc_type;
     wxTextCtrl *disc_device;
-    wxSpinCtrl *disc_title;
-    int        i_disc_title;
-    wxSpinCtrl *disc_chapter;
-    int        i_disc_chapter;
-
+    wxSpinCtrl *disc_title; int i_disc_title;
+    wxSpinCtrl *disc_chapter; int i_disc_chapter;
+    wxSpinCtrl *disc_sub; int i_disc_sub;
+
+    /* The media equivalent name for a DVD names. For example,
+     * "Title", is "Track" for a CD-DA */
+    wxStaticText *disc_title_label;
+    wxStaticText *disc_chapter_label;
+    wxStaticText *disc_sub_label;
+    
+    /* Indicates if the disc device control was modified */
+    bool b_disc_device_changed;
+    
     /* Controls for the net panel */
     wxRadioBox *net_type;
     int i_net_type;
@@ -385,14 +483,7 @@ private:
     wxSpinCtrl *net_ports[4];
     int        i_net_ports[4];
     wxTextCtrl *net_addrs[4];
-
-    /* Controls for the v4l panel */
-    wxRadioBox *video_type;
-    wxTextCtrl *video_device;
-    wxSpinCtrl *video_channel;
-    wxButton *v4l_button;
-    V4LDialog *v4l_dialog;
-    wxArrayString v4l_mrl;
+    wxCheckBox *net_ipv6;
 
     /* Controls for the subtitles file */
     wxButton *subsfile_button;
@@ -405,6 +496,11 @@ private:
     wxCheckBox *sout_checkbox;
     SoutDialog *sout_dialog;
     wxArrayString sout_mrl;
+
+    /* Controls for the caching options */
+    wxCheckBox *caching_checkbox;
+    wxSpinCtrl *caching_value;
+    int i_caching;
 };
 
 enum
@@ -412,80 +508,11 @@ enum
     FILE_ACCESS = 0,
     DISC_ACCESS,
     NET_ACCESS,
-#ifndef WIN32
-    V4L_ACCESS,
-#endif
-    MAX_ACCESS,
-    FILE_SIMPLE_ACCESS
-};
-
-/* V4L Dialog */
-class V4LDialog: public wxDialog
-{
-public:
-    /* Constructor */
-    V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
-    virtual ~V4LDialog();
-
-    wxArrayString GetOptions();
-
-private:
-    void UpdateMRL();
-    wxPanel *AudioPanel( wxWindow* parent );
-    wxPanel *CommonPanel( wxWindow* parent );
-    wxPanel *BitratePanel( 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 OnAudioEnable( wxCommandEvent& event );
-    void OnAudioChannel( wxCommandEvent& event );
-    void OnSizeEnable( wxCommandEvent& event );
-    void OnSize( wxCommandEvent& event );
-    void OnNormEnable( wxCommandEvent& event );
-    void OnNorm( wxCommandEvent& event );
-    void OnFrequencyEnable( wxCommandEvent& event );
-    void OnFrequency( wxCommandEvent& event );
-    void OnBitrateEnable( wxCommandEvent& event );
-    void OnBitrate( wxCommandEvent& event );
-    void OnMaxBitrateEnable( wxCommandEvent& event );
-    void OnMaxBitrate( wxCommandEvent& event );
-
-    DECLARE_EVENT_TABLE();
-
-    intf_thread_t *p_intf;
-    wxWindow *p_parent;
-
-    wxComboBox *mrl_combo;
-
-    int i_access_type;
-
-    /* Controls for the v4l advanced options */
-    wxPanel *common_subpanel;
-    wxPanel *common_panel;
-    wxCheckBox *size_checkbox;
-    wxComboBox *size_combo;
-    wxCheckBox *norm_checkbox;
-    wxComboBox *norm_combo;
-    wxCheckBox *frequency_checkbox;
-    wxSpinCtrl *frequency;
-
-    wxPanel *audio_subpanel;
-    wxPanel *audio_panel;
-    wxCheckBox *audio_checkbox;
-    wxTextCtrl *audio_device;
-    wxSpinCtrl *audio_channel;
-
-    wxPanel *bitrate_subpanel;
-    wxPanel *bitrate_panel;
-    wxCheckBox *bitrate_checkbox;
-    wxSpinCtrl *bitrate;
-    wxCheckBox *maxbitrate_checkbox;
-    wxSpinCtrl *maxbitrate;
 
+    /* Auto-built panels */
+    CAPTURE_ACCESS
 };
+#define MAX_ACCESS CAPTURE_ACCESS
 
 /* Stream output Dialog */
 enum
@@ -506,9 +533,11 @@ enum
     MPEG1_ENCAPSULATION,
     OGG_ENCAPSULATION,
     ASF_ENCAPSULATION,
-    AVI_ENCAPSULATION,
     MP4_ENCAPSULATION,
     MOV_ENCAPSULATION,
+    WAV_ENCAPSULATION,
+    RAW_ENCAPSULATION,
+    AVI_ENCAPSULATION,
     ENCAPS_NUM
 };
 
@@ -550,8 +579,9 @@ private:
     void OnNetChange( wxCommandEvent& event );
 
     /* Event specific to the announce address */
+    void OnAnnounceGroupChange( wxCommandEvent& event );
     void OnAnnounceAddrChange( wxCommandEvent& event );
-
+    
     /* Event handlers for the encapsulation panel */
     void OnEncapsulationChange( wxCommandEvent& event );
 
@@ -587,6 +617,7 @@ private:
     wxPanel *misc_subpanels[MISC_SOUT_NUM];
     wxCheckBox *sap_checkbox;
     wxCheckBox *slp_checkbox;
+    wxTextCtrl *announce_group;
     wxTextCtrl *announce_addr;
 
     /* Controls for the encapsulation */
@@ -603,6 +634,7 @@ private:
     wxComboBox *video_bitrate_combo;
     wxComboBox *audio_bitrate_combo;
     wxComboBox *audio_channels_combo;
+    wxComboBox *video_scale_combo;
 };
 
 /* Subtitles File Dialog */
@@ -615,8 +647,10 @@ public:
 
     wxComboBox *file_combo;
     wxComboBox *encoding_combo;
-    wxSpinCtrl *delay_spinctrl;
+    wxComboBox *size_combo;
+    wxComboBox *align_combo;
     wxSpinCtrl *fps_spinctrl;
+    wxSpinCtrl *delay_spinctrl;
 
 private:
     /* Event handlers (these functions should _not_ be virtual) */
@@ -658,10 +692,40 @@ private:
     SoutDialog *p_sout_dialog;
 };
 
+/* Wizard */
+class WizardDialog : public wxWizard
+{
+public:
+    /* Constructor */
+    WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent,char *, int, int );
+    virtual ~WizardDialog();
+    void SetTranscode( char *vcodec, int vb, char *acodec,int ab);
+    void SetMrl( const char *mrl );
+    void SetTTL( int i_ttl );
+    void SetPartial( int, int );
+    void SetStream( char *method, char *address );
+    void SetTranscodeOut( char *address );
+    void SetAction( int i_action );
+    int  GetAction();
+    void SetSAP( bool b_enabled, const char *psz_name );
+    void SetMux( char *mux );
+    void Run();
+    int i_action;
+    char *method;
+
+protected:
+    int vb,ab;
+    int i_from, i_to, i_ttl;
+    char *vcodec , *acodec , *address , *mrl , *mux ;
+    char *psz_sap_name;
+    bool b_sap;
+    DECLARE_EVENT_TABLE();
+
+    intf_thread_t *p_intf;
+};
 
 
 /* Preferences Dialog */
-class PrefsTreeCtrl;
 class PrefsDialog: public wxFrame
 {
 public:
@@ -717,8 +781,6 @@ private:
 };
 
 /* Playlist */
-class ItemInfoDialog;
-class NewGroup;
 class Playlist: public wxFrame
 {
 public:
@@ -728,87 +790,119 @@ public:
 
     void UpdatePlaylist();
     void ShowPlaylist( bool show );
+    void UpdateItem( int );
+    void AppendItem( wxCommandEvent& );
 
     bool b_need_update;
-    vlc_mutex_t lock;
 
 private:
+    void RemoveItem( int );
     void DeleteItem( int item );
+    void DeleteNode( playlist_item_t *node );
 
     /* Event handlers (these functions should _not_ be virtual) */
+
+    /* Menu Handlers */
     void OnAddFile( wxCommandEvent& event );
+    void OnAddDir( wxCommandEvent& event );
     void OnAddMRL( wxCommandEvent& event );
     void OnClose( wxCommandEvent& event );
-    void OnSearch( wxCommandEvent& event );
-    void OnEnDis( wxCommandEvent& event );
-    void OnInfos( wxCommandEvent& event );
-    void OnSearchTextChange( wxCommandEvent& event );
+
+    void OnEnableSelection( wxCommandEvent& event );
+    void OnDisableSelection( wxCommandEvent& event );
+    void OnInvertSelection( wxCommandEvent& event );
+    void OnDeleteSelection( wxCommandEvent& event );
+    void OnSelectAll( wxCommandEvent& event );
+
     void OnOpen( wxCommandEvent& event );
     void OnSave( wxCommandEvent& event );
 
+    /* Search (user) */
+    void OnSearch( wxCommandEvent& event );
+    void OnSearchTextChange( wxCommandEvent& event );
+    wxTextCtrl *search_text;
+    wxButton *search_button;
+    wxTreeItemId search_current;
+
+    void OnEnDis( wxCommandEvent& event );
+
+    /* Sort */
+    int i_sort_mode;
     void OnSort( wxCommandEvent& event );
-    void OnColSelect( wxListEvent& event );
+    int i_title_sorted;
+    int i_group_sorted;
+    int i_duration_sorted;
+
+    /* Dynamic menus */
+    void OnMenuEvent( wxCommandEvent& event );
+    void OnMenuOpen( wxMenuEvent& event );
+    wxMenu *p_view_menu;
+    wxMenu *p_sd_menu;
+    wxMenu *ViewMenu();
+    wxMenu *SDMenu();
 
     void OnUp( wxCommandEvent& event);
     void OnDown( wxCommandEvent& event);
 
-    void OnEnableSelection( wxCommandEvent& event );
-    void OnDisableSelection( wxCommandEvent& event );
-    void OnInvertSelection( wxCommandEvent& event );
-    void OnDeleteSelection( wxCommandEvent& event );
-    void OnSelectAll( wxCommandEvent& event );
     void OnRandom( wxCommandEvent& event );
     void OnRepeat( wxCommandEvent& event );
     void OnLoop ( wxCommandEvent& event );
-    void OnActivateItem( wxListEvent& event );
-    void OnKeyDown( wxListEvent& event );
+
+    void OnActivateItem( wxTreeEvent& event );
+    void OnKeyDown( wxTreeEvent& event );
     void OnNewGroup( wxCommandEvent& event );
 
+    /* Popup  */
+    wxMenu *item_popup;
+    wxMenu *node_popup;
+    wxTreeItemId i_popup_item;
+    playlist_item_t *p_popup_item;
+    playlist_item_t *p_popup_parent;
+    void OnPopup( wxContextMenuEvent& event );
+    void OnPopupPlay( wxMenuEvent& event );
+    void OnPopupPreparse( wxMenuEvent& event );
+    void OnPopupSort( wxMenuEvent& event );
+    void OnPopupDel( wxMenuEvent& event );
+    void OnPopupEna( wxMenuEvent& event );
+    void OnPopupInfo( wxMenuEvent& event );
     void Rebuild();
 
-    wxTextCtrl *search_text;
-    wxButton *search_button;
-    DECLARE_EVENT_TABLE();
+    void Preparse( playlist_t *p_playlist );
 
+    /* Update */
+    void UpdateNode( playlist_t *, playlist_item_t*, wxTreeItemId );
+    void UpdateNodeChildren( playlist_t *, playlist_item_t*, wxTreeItemId );
+    void CreateNode( playlist_t *, playlist_item_t*, wxTreeItemId );
+    void UpdateTreeItem( playlist_t *, wxTreeItemId );
+    void SetCurrentItem( wxTreeItemId );
 
-    ItemInfoDialog *iteminfo_dialog;
-
-    intf_thread_t *p_intf;
-    wxListView *listview;
-    wxTreeCtrl *treeview;
-    int i_update_counter;
-    int i_sort_mode;
-
-    int i_title_sorted;
-    int i_author_sorted;
-    int i_group_sorted;
-};
+    /* Search (internal) */
+    int CountItems( wxTreeItemId);
+    wxTreeItemId FindItem( wxTreeItemId, playlist_item_t * );
+    wxTreeItemId FindItem( wxTreeItemId, int );
+    wxTreeItemId FindItemByName( wxTreeItemId, wxString,
+                                 wxTreeItemId, vlc_bool_t *);
 
+    /* Custom events */
+    void OnPlaylistEvent( wxCommandEvent& event );
 
-class NewGroup: public wxDialog
-{
-public:
-    /* Constructor */
-    NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
-    virtual ~NewGroup();
+    DECLARE_EVENT_TABLE();
 
-private:
 
-    /* Event handlers (these functions should _not_ be virtual) */
-    void OnOk( wxCommandEvent& event );
-    void OnCancel( wxCommandEvent& event );
+    /* Global widgets */
+    wxStatusBar *statusbar;
+    ItemInfoDialog *iteminfo_dialog;
 
-    DECLARE_EVENT_TABLE();
+    int i_update_counter;
 
     intf_thread_t *p_intf;
-    wxTextCtrl *groupname;
+    wxTreeCtrl *treectrl;
+    int i_current_view;
+    vlc_bool_t b_changed_view;
+    char **pp_sds;
 
-protected:
-    friend class Playlist;
-    friend class ItemInfoDialog;
-    char *psz_name;
-};
 
+};
 
 /* ItemInfo Dialog */
 class ItemInfoDialog: public wxDialog
@@ -828,7 +922,8 @@ private:
     /* Event handlers (these functions should _not_ be virtual) */
     void OnOk( wxCommandEvent& event );
     void OnCancel( wxCommandEvent& event );
-    void OnNewGroup( wxCommandEvent& event );
+
+    void UpdateInfo();
 
     DECLARE_EVENT_TABLE();
 
@@ -845,11 +940,10 @@ private:
 
     wxTextCtrl *uri_text;
     wxTextCtrl *name_text;
-    wxTextCtrl *author_text;
 
-    wxCheckBox *enabled_checkbox;
-    wxComboBox *group_combo;
-    int ids_array[100];
+    wxTreeCtrl *info_tree;
+    wxTreeItemId info_root;
+
 };
 
 
@@ -862,6 +956,8 @@ public:
     virtual ~FileInfo();
     void UpdateFileInfo();
 
+    vlc_bool_t b_need_update;
+
 private:
     void OnClose( wxCommandEvent& event );
 
@@ -872,10 +968,10 @@ private:
     wxTreeItemId fileinfo_root;
     wxString fileinfo_root_label;
 
-};
 
+};
 
-#if !defined(__WXX11__)
+#if wxUSE_DRAG_AND_DROP
 /* Drag and Drop class */
 class DragAndDrop: public wxFileDropTarget
 {
@@ -890,15 +986,17 @@ private:
     vlc_bool_t b_enqueue;
 };
 #endif
+} // end of wxvlc namespace
 
 /* Menus */
-void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
-                const wxPoint& pos );
-wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
-wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
-wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
-wxMenu *MiscMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
+void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
+wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
+wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
+wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
+wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
 
+namespace wxvlc
+{
 class MenuEvtHandler : public wxEvtHandler
 {
 public:
@@ -916,75 +1014,5 @@ private:
     Interface *p_main_interface;
 };
 
-class Menu: public wxMenu
-{
-public:
-    /* Constructor */
-    Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
-          char **ppsz_names, int *pi_objects, int i_start_id );
-    virtual ~Menu();
-
-private:
-    /* Event handlers (these functions should _not_ be virtual) */
-    void OnClose( wxCommandEvent& event );
-    void OnShowDialog( wxCommandEvent& event );
-    void OnEntrySelected( wxCommandEvent& event );
-
-    wxMenu *Menu::CreateDummyMenu();
-    void   Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
-    wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t * );
-
-    DECLARE_EVENT_TABLE();
-
-    intf_thread_t *p_intf;
-
-    int  i_item_id;
-};
-
-static inline int ConvertHotkeyModifiers( int i_hotkey )
-{
-    int i_accel_flags = 0;
-    if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
-    if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
-    if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
-    return i_accel_flags;
-}
-
-static inline int ConvertHotkey( int i_hotkey )
-{
-    int i_key = i_hotkey & ~KEY_MODIFIER;
-    if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
-    else if( i_key & KEY_SPECIAL )
-    {
-        switch ( i_key )
-        {
-        case KEY_LEFT: return WXK_LEFT;
-        case KEY_RIGHT: return WXK_RIGHT;
-        case KEY_UP: return WXK_UP;
-        case KEY_DOWN: return WXK_DOWN;
-        case KEY_SPACE: return WXK_SPACE;
-        case KEY_ENTER: return WXK_RETURN;
-        case KEY_F1: return WXK_F1;
-        case KEY_F2: return WXK_F2;
-        case KEY_F3: return WXK_F3;
-        case KEY_F4: return WXK_F4;
-        case KEY_F5: return WXK_F5;
-        case KEY_F6: return WXK_F6;
-        case KEY_F7: return WXK_F7;
-        case KEY_F8: return WXK_F8;
-        case KEY_F9: return WXK_F9;
-        case KEY_F10: return WXK_F10;
-        case KEY_F11: return WXK_F11;
-        case KEY_F12: return WXK_F12;
-        case KEY_HOME: return WXK_HOME;
-        case KEY_END: return WXK_HOME;
-        case KEY_MENU: return WXK_MENU;
-        case KEY_ESC: return WXK_ESCAPE;
-        case KEY_PAGEUP: return WXK_PRIOR;
-        case KEY_PAGEDOWN: return WXK_NEXT;
-        case KEY_TAB: return WXK_TAB;
-        case KEY_BACKSPACE: return WXK_BACK;
-        }
-    }
-    return 0;
-}
+} // end of wxvlc namespace
+using namespace wxvlc;