]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwindows/wxwindows.h
cdda/info.c: changes for libcddb 1.1.0 API
[vlc] / modules / gui / wxwindows / wxwindows.h
index 39850c5069e1370a5c6fd79df049989b8a988a0b..5936b3ddf36c445b8132ac8fa0a590675af129ae 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
- * Copyright (C) 1999-2005 VideoLAN
+ * Copyright (C) 1999-2005 the VideoLAN team
  * $Id$
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
 #include <wx/taskbar.h>
 #include "vlc_keys.h"
 
-/* Hmmm, work-around for newest wxWin */
-#ifdef wxStaticCastEvent
-#   undef wxStaticCastEvent
-#   define wxStaticCastEvent(type, val) ((type)(val))
+#if (!wxCHECK_VERSION(2,5,0))
+typedef long wxTreeItemIdValue;
 #endif
 
 DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
@@ -89,6 +87,11 @@ DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
 #define MODE_AUTHOR 2
 #define MODE_TITLE 3
 
+enum{
+  ID_CONTROLS_TIMER,
+  ID_SLIDER_TIMER,
+};
+
 class DialogsProvider;
 class PrefsTreeCtrl;
 class AutoBuiltPanel;
@@ -140,6 +143,7 @@ struct intf_sys_t
     /* Embedded vout */
     VideoWindow         *p_video_window;
     wxBoxSizer          *p_video_sizer;
+    vlc_bool_t          b_video_autosize;
 
     /* Aout */
     aout_instance_t     *p_aout;
@@ -150,6 +154,7 @@ struct intf_sys_t
  *****************************************************************************/
 wxArrayString SeparateEntries( wxString );
 wxWindow *CreateVideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
+void UpdateVideoWindow( intf_thread_t *p_intf, wxWindow *p_window );
 wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
 wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
 
@@ -182,13 +187,14 @@ public:
     virtual void Notify();
 
 private:
+    //use wxWindow::IsShown instead
+    //vlc_bool_t b_slider_shown;
+    //vlc_bool_t b_disc_shown;
     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;
 };
 
 
@@ -227,7 +233,10 @@ private:
 
     wxCheckBox *eq_2p_chkbox;
 
+    wxButton *eq_restoredefaults_button;
+
     wxSlider *smooth_slider;
+    wxStaticText *smooth_text;
 
     wxSlider *preamp_slider;
     wxStaticText * preamp_text;
@@ -294,12 +303,13 @@ private:
 class Systray: public wxTaskBarIcon
 {
 public:
-    Systray( Interface* p_main_interface );
+    Systray( Interface* p_main_interface, intf_thread_t *p_intf );
     virtual ~Systray() {};
     wxMenu* CreatePopupMenu();
     void UpdateTooltip( const wxChar* tooltip );
 
 private:
+    void OnMenuIconize( wxCommandEvent& event );
     void OnLeftClick( wxTaskBarIconEvent& event );
     void OnPlayStream ( wxCommandEvent& event );
     void OnStopStream ( wxCommandEvent& event );
@@ -307,6 +317,7 @@ private:
     void OnNextStream ( wxCommandEvent& event );
     void OnExit(  wxCommandEvent& event );
     Interface* p_main_interface;
+    intf_thread_t *p_intf;
     DECLARE_EVENT_TABLE()
 };
 #endif
@@ -329,11 +340,17 @@ public:
     wxBoxSizer  *frame_sizer;
     wxStatusBar *statusbar;
 
+    void HideSlider(bool layout = true);
+    void ShowSlider(bool show = true, bool layout = true);
+
     wxSlider    *slider;
     wxWindow    *slider_frame;
     wxBoxSizer  *slider_sizer;
     wxPanel     *extra_frame;
 
+    void HideDiscFrame(bool layout = true);
+    void ShowDiscFrame(bool show = true, bool layout = true);
+
     wxPanel         *disc_frame;
     wxBoxSizer      *disc_sizer;
     wxBitmapButton  *disc_menu_button;
@@ -351,6 +368,9 @@ public:
     Systray     *p_systray;
 #endif
 
+    wxTimer m_controls_timer;
+    wxTimer m_slider_timer;
+
 private:
     void SetupHotkeys();
     void CreateOurMenuBar();
@@ -360,6 +380,9 @@ private:
     void Open( int i_access_method );
 
     /* Event handlers (these functions should _not_ be virtual) */
+    void OnControlsTimer(wxTimerEvent& WXUNUSED(event));
+    void OnSliderTimer(wxTimerEvent& WXUNUSED(event));
+
     void OnExit( wxCommandEvent& event );
     void OnAbout( wxCommandEvent& event );
 
@@ -401,7 +424,8 @@ private:
     Timer *timer;
     intf_thread_t *p_intf;
 
-private:
+    wxWindow *video_window;
+
     int i_old_playing_status;
 
     /* For auto-generated menus */
@@ -443,6 +467,7 @@ private:
     /* Event handlers (these functions should _not_ be virtual) */
     void OnOk( wxCommandEvent& event );
     void OnCancel( wxCommandEvent& event );
+    void OnClose( wxCloseEvent& event );
 
     void OnPageChange( wxNotebookEvent& event );
     void OnMRLChange( wxCommandEvent& event );
@@ -452,11 +477,16 @@ private:
     void OnFileBrowse( wxCommandEvent& event );
 
     /* Event handlers for the disc page */
+    void OnDiscPanelChangeSpin( wxSpinEvent& event );
     void OnDiscPanelChange( wxCommandEvent& event );
     void OnDiscTypeChange( wxCommandEvent& event );
+#ifdef HAVE_LIBCDIO
+    void OnDiscProbe( wxCommandEvent& event );
+#endif
     void OnDiscDeviceChange( wxCommandEvent& event );
 
     /* Event handlers for the net page */
+    void OnNetPanelChangeSpin( wxSpinEvent& event );
     void OnNetPanelChange( wxCommandEvent& event );
     void OnNetTypeChange( wxCommandEvent& event );
 
@@ -471,6 +501,7 @@ private:
     /* Event handlers for the caching option */
     void OnCachingEnable( wxCommandEvent& event );
     void OnCachingChange( wxCommandEvent& event );
+    void OnCachingChangeSpin( wxSpinEvent& event );
 
     DECLARE_EVENT_TABLE();
 
@@ -491,16 +522,19 @@ private:
 
     /* Controls for the disc panel */
     wxRadioBox *disc_type;
+    wxCheckBox *disc_probe;
     wxTextCtrl *disc_device;
     wxSpinCtrl *disc_title; int i_disc_title;
     wxSpinCtrl *disc_chapter; int i_disc_chapter;
     wxSpinCtrl *disc_sub; int i_disc_sub;
+    wxSpinCtrl *disc_audio; int i_disc_audio;
 
     /* 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;
+    wxStaticText *disc_audio_label;
 
     /* Indicates if the disc device control was modified */
     bool b_disc_device_changed;
@@ -733,18 +767,18 @@ class WizardDialog : public wxWizard
 {
 public:
     /* Constructor */
-    WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent,char *, int, int );
+    WizardDialog( intf_thread_t *, wxWindow *p_parent, char *, int, int );
     virtual ~WizardDialog();
-    void SetTranscode( char *vcodec, int vb, char *acodec,int ab);
+    void SetTranscode( char const *vcodec, int vb, char const *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( const char *address );
+    void SetStream( char const *method, char const *address );
+    void SetTranscodeOut( char const *address );
     void SetAction( int i_action );
     int  GetAction();
     void SetSAP( bool b_enabled, const char *psz_name );
-    void SetMux( char *mux );
+    void SetMux( char const *mux );
     void Run();
     int i_action;
     char *method;
@@ -778,6 +812,7 @@ private:
     void OnSave( wxCommandEvent& event );
     void OnResetAll( wxCommandEvent& event );
     void OnAdvanced( wxCommandEvent& event );
+    void OnClose( wxCloseEvent& event );
 
     DECLARE_EVENT_TABLE();
 
@@ -798,7 +833,8 @@ public:
 
 private:
     /* Event handlers (these functions should _not_ be virtual) */
-    void OnClose( wxEvent& event );
+    void OnButtonClose( wxCommandEvent& event );
+    void OnClose( wxCloseEvent& WXUNUSED(event) );
     void OnClear( wxCommandEvent& event );
     void OnSaveLog( wxCommandEvent& event );
 
@@ -833,29 +869,29 @@ public:
 
 private:
     void RemoveItem( int );
+    void DeleteTreeItem( wxTreeItemId );
     void DeleteItem( int item );
     void DeleteNode( playlist_item_t *node );
 
+    void RecursiveDeleteSelection( wxTreeItemId );
+
     /* 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 OnMenuClose( wxCommandEvent& event );
+    void OnClose( wxCloseEvent& WXUNUSED(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 );
+    /*void OnSearchTextChange( wxCommandEvent& event );*/
     wxTextCtrl *search_text;
     wxButton *search_button;
     wxTreeItemId search_current;
@@ -891,35 +927,36 @@ private:
     /* Popup  */
     wxMenu *item_popup;
     wxMenu *node_popup;
-    wxTreeItemId i_popup_item;
-    playlist_item_t *p_popup_item;
-    playlist_item_t *p_popup_parent;
+    wxTreeItemId i_wx_popup_item;
+    int i_popup_item;
+    int i_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 OnPopupPlay( wxCommandEvent& event );
+    void OnPopupPreparse( wxCommandEvent& event );
+    void OnPopupSort( wxCommandEvent& event );
+    void OnPopupDel( wxCommandEvent& event );
+    void OnPopupEna( wxCommandEvent& event );
+    void OnPopupInfo( wxCommandEvent& event );
     void Rebuild( vlc_bool_t );
 
-    void Preparse( playlist_t *p_playlist );
+    void Preparse();
 
     /* 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 UpdateNode( playlist_item_t*, wxTreeItemId );
+    void UpdateNodeChildren( playlist_item_t*, wxTreeItemId );
+    void CreateNode( playlist_item_t*, wxTreeItemId );
+    void UpdateTreeItem( wxTreeItemId );
 
     /* Search (internal) */
     int CountItems( wxTreeItemId);
-    wxTreeItemId FindItem( wxTreeItemId, playlist_item_t * );
     wxTreeItemId FindItem( wxTreeItemId, int );
     wxTreeItemId FindItemByName( wxTreeItemId, wxString,
                                  wxTreeItemId, vlc_bool_t *);
 
     wxTreeItemId saved_tree_item;
-    playlist_item_t *p_saved_item;
+    int i_saved_id;
+
+    playlist_t *p_playlist;
 
 
     /* Custom events */
@@ -998,7 +1035,8 @@ public:
     vlc_bool_t b_need_update;
 
 private:
-    void OnClose( wxCommandEvent& event );
+    void OnButtonClose( wxCommandEvent& event );
+    void OnClose( wxCloseEvent& WXUNUSED(event) );
 
     DECLARE_EVENT_TABLE();
 
@@ -1040,6 +1078,7 @@ public:
         ID_MESSAGES,
         ID_FILE_INFO,
         ID_BOOKMARKS,
+        ID_VIDEO,
 
         ID_MAX,
     };