1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999-2005 the VideoLAN team
7 * Authors: Gildas Bazin <gbazin@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 #ifdef WIN32 /* mingw32 hack */
29 /* Let vlc take care of the i18n stuff */
30 #define WXINTL_NO_GETTEXT_MACRO
32 #include <wx/wxprec.h>
35 #include <wx/listctrl.h>
36 #include <wx/textctrl.h>
37 #include <wx/notebook.h>
38 #include <wx/spinctrl.h>
40 #include <wx/treectrl.h>
43 #include <wx/checkbox.h>
44 #include <wx/wizard.h>
45 #include <wx/taskbar.h>
48 #if (!wxCHECK_VERSION(2,5,0))
49 typedef long wxTreeItemIdValue;
52 DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
53 DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
55 #define SLIDER_MAX_POS 10000
57 /* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
58 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
60 # define wxU(utf8) wxString(utf8, wxConvUTF8)
62 # define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
66 #else // ENABLE_NLS && ENABLE_UTF8
68 # define wxU(ansi) wxString(ansi, wxConvLocal)
70 # define wxU(ansi) (ansi)
76 /* wxL2U (locale to unicode) is used to convert ansi strings to unicode
77 * strings (wchar_t) */
78 #define wxL2U(ansi) wxU(ansi)
95 class DialogsProvider;
101 /*****************************************************************************
102 * intf_sys_t: description and status of wxwindows interface
103 *****************************************************************************/
106 /* the wx parent window */
107 wxWindow *p_wxwindow;
110 /* window settings */
111 WindowSettings *p_window_settings;
113 /* special actions */
114 vlc_bool_t b_playing;
115 vlc_bool_t b_intf_show; /* interface to be shown */
117 /* The input thread */
118 input_thread_t * p_input;
121 int i_slider_pos; /* slider position */
122 int i_slider_oldpos; /* previous position */
123 vlc_bool_t b_slider_free; /* slider status */
125 /* The messages window */
126 msg_subscription_t* p_sub; /* message bank subscription */
128 /* Playlist management */
129 int i_playing; /* playlist selected item */
130 unsigned i_playlist_usage;
132 /* Send an event to show a dialog */
133 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
134 intf_dialog_args_t *p_arg );
137 wxMenu *p_popup_menu;
140 int i_first_hotkey_event;
144 VideoWindow *p_video_window;
145 wxBoxSizer *p_video_sizer;
146 vlc_bool_t b_video_autosize;
149 aout_instance_t *p_aout;
152 /*****************************************************************************
154 *****************************************************************************/
155 wxArrayString SeparateEntries( wxString );
156 wxWindow *CreateVideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
157 void UpdateVideoWindow( intf_thread_t *p_intf, wxWindow *p_window );
158 wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
159 wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
166 class SubsFileDialog;
172 class ItemInfoDialog;
174 class ExportPlaylist;
176 /*****************************************************************************
177 * Classes declarations.
178 *****************************************************************************/
180 class Timer: public wxTimer
184 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
187 virtual void Notify();
190 //use wxWindow::IsShown instead
191 //vlc_bool_t b_slider_shown;
192 //vlc_bool_t b_disc_shown;
193 intf_thread_t *p_intf;
194 Interface *p_main_interface;
196 int i_old_playing_status;
202 class ExtraPanel: public wxPanel
206 ExtraPanel( intf_thread_t *p_intf, wxWindow *p_parent );
207 virtual ~ExtraPanel();
209 wxStaticBox *adjust_box;
210 wxButton *restoredefaults_button;
211 wxSlider *brightness_slider;
212 wxSlider *contrast_slider;
213 wxSlider *saturation_slider;
214 wxSlider *hue_slider;
215 wxSlider *gamma_slider;
217 wxStaticBox *other_box;
218 wxComboBox *ratio_combo;
226 wxPanel *VideoPanel( wxWindow * );
227 wxPanel *EqzPanel( wxWindow * );
228 wxPanel *AudioPanel( wxWindow * );
230 wxNotebook *notebook;
232 wxCheckBox *eq_chkbox;
234 wxCheckBox *eq_2p_chkbox;
236 wxButton *eq_restoredefaults_button;
238 wxSlider *smooth_slider;
239 wxStaticText *smooth_text;
241 wxSlider *preamp_slider;
242 wxStaticText * preamp_text;
247 wxSlider *band_sliders[10];
248 wxStaticText *band_texts[10];
254 /* Event handlers (these functions should _not_ be virtual) */
256 void OnEnableAdjust( wxCommandEvent& );
257 void OnEnableEqualizer( wxCommandEvent& );
258 void OnRestoreDefaults( wxCommandEvent& );
259 void OnChangeEqualizer( wxScrollEvent& );
260 void OnAdjustUpdate( wxScrollEvent& );
261 void OnRatio( wxCommandEvent& );
262 void OnFiltersInfo( wxCommandEvent& );
263 void OnSelectFilter( wxCommandEvent& );
265 void OnEqSmooth( wxScrollEvent& );
266 void OnPreamp( wxScrollEvent& );
267 void OnEq2Pass( wxCommandEvent& );
268 void OnEqRestore( wxCommandEvent& );
270 void OnHeadphone( wxCommandEvent& );
271 void OnNormvol( wxCommandEvent& );
272 void OnNormvolSlider( wxScrollEvent& );
274 void OnIdle( wxIdleEvent& );
276 DECLARE_EVENT_TABLE();
278 intf_thread_t *p_intf;
279 vlc_bool_t b_my_update;
283 /* Extended Window */
284 class ExtraWindow: public wxFrame
288 ExtraWindow( intf_thread_t *p_intf, wxWindow *p_parent, wxPanel *panel );
289 virtual ~ExtraWindow();
295 DECLARE_EVENT_TABLE();
297 intf_thread_t *p_intf;
301 /* Systray integration */
302 #ifdef wxHAS_TASK_BAR_ICON
303 class Systray: public wxTaskBarIcon
306 Systray( Interface* p_main_interface, intf_thread_t *p_intf );
307 virtual ~Systray() {};
308 wxMenu* CreatePopupMenu();
309 void UpdateTooltip( const wxChar* tooltip );
312 void OnMenuIconize( wxCommandEvent& event );
313 void OnLeftClick( wxTaskBarIconEvent& event );
314 void OnPlayStream ( wxCommandEvent& event );
315 void OnStopStream ( wxCommandEvent& event );
316 void OnPrevStream ( wxCommandEvent& event );
317 void OnNextStream ( wxCommandEvent& event );
318 void OnExit( wxCommandEvent& event );
319 Interface* p_main_interface;
320 intf_thread_t *p_intf;
321 DECLARE_EVENT_TABLE()
326 class Interface: public wxFrame
330 Interface( intf_thread_t *p_intf, long style = wxDEFAULT_FRAME_STYLE );
331 virtual ~Interface();
333 void TogglePlayButton( int i_playing_status );
340 wxBoxSizer *frame_sizer;
341 wxStatusBar *statusbar;
343 void HideSlider(bool layout = true);
344 void ShowSlider(bool show = true, bool layout = true);
347 wxWindow *slider_frame;
348 wxBoxSizer *slider_sizer;
349 wxPanel *extra_frame;
351 void HideDiscFrame(bool layout = true);
352 void ShowDiscFrame(bool show = true, bool layout = true);
355 wxBoxSizer *disc_sizer;
356 wxBitmapButton *disc_menu_button;
357 wxBitmapButton *disc_prev_button;
358 wxBitmapButton *disc_next_button;
360 wxFrame *extra_window;
367 #ifdef wxHAS_TASK_BAR_ICON
371 wxTimer m_controls_timer;
372 wxTimer m_slider_timer;
376 void CreateOurMenuBar();
377 void CreateOurToolBar();
378 void CreateOurExtendedPanel();
379 void CreateOurSlider();
380 void Open( int i_access_method );
382 /* Event handlers (these functions should _not_ be virtual) */
383 void OnControlsTimer(wxTimerEvent& WXUNUSED(event));
384 void OnSliderTimer(wxTimerEvent& WXUNUSED(event));
386 void OnExit( wxCommandEvent& event );
387 void OnAbout( wxCommandEvent& event );
389 void OnOpenFileSimple( wxCommandEvent& event );
390 void OnOpenDir( wxCommandEvent& event );
391 void OnOpenFile( wxCommandEvent& event );
392 void OnOpenDisc( wxCommandEvent& event );
393 void OnOpenNet( wxCommandEvent& event );
394 void OnOpenSat( wxCommandEvent& event );
396 void OnExtended( wxCommandEvent& event );
397 //void OnUndock( wxCommandEvent& event );
399 void OnBookmarks( wxCommandEvent& event );
400 void OnShowDialog( wxCommandEvent& event );
401 void OnPlayStream( wxCommandEvent& event );
402 void OnStopStream( wxCommandEvent& event );
403 void OnSliderUpdate( wxScrollEvent& event );
404 void OnPrevStream( wxCommandEvent& event );
405 void OnNextStream( wxCommandEvent& event );
406 void OnSlowStream( wxCommandEvent& event );
407 void OnFastStream( wxCommandEvent& event );
409 void OnDiscMenu( wxCommandEvent& event );
410 void OnDiscPrev( wxCommandEvent& event );
411 void OnDiscNext( wxCommandEvent& event );
413 void OnMenuOpen( wxMenuEvent& event );
415 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
416 void OnContextMenu2(wxContextMenuEvent& event);
418 void OnContextMenu(wxMouseEvent& event);
420 void OnControlEvent( wxCommandEvent& event );
422 DECLARE_EVENT_TABLE();
425 intf_thread_t *p_intf;
427 wxWindow *video_window;
429 int i_old_playing_status;
431 /* For auto-generated menus */
432 wxMenu *p_settings_menu;
433 wxMenu *p_audio_menu;
434 wxMenu *p_video_menu;
435 wxMenu *p_navig_menu;
439 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
440 class OpenDialog: public wxDialog
444 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
445 int i_access_method, int i_arg = 0 );
447 /* Extended Contructor */
448 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
449 int i_access_method, int i_arg = 0 , int _i_method = 0 );
450 virtual ~OpenDialog();
453 int Show( int i_access_method, int i_arg = 0 );
456 void UpdateMRL( int i_access_method );
461 wxPanel *FilePanel( wxWindow* parent );
462 wxPanel *DiscPanel( wxWindow* parent );
463 wxPanel *NetPanel( wxWindow* parent );
465 ArrayOfAutoBuiltPanel input_tab_array;
467 /* Event handlers (these functions should _not_ be virtual) */
468 void OnOk( wxCommandEvent& event );
469 void OnCancel( wxCommandEvent& event );
470 void OnClose( wxCloseEvent& event );
472 void OnPageChange( wxNotebookEvent& event );
473 void OnMRLChange( wxCommandEvent& event );
475 /* Event handlers for the file page */
476 void OnFilePanelChange( wxCommandEvent& event );
477 void OnFileBrowse( wxCommandEvent& event );
479 /* Event handlers for the disc page */
480 void OnDiscPanelChangeSpin( wxSpinEvent& event );
481 void OnDiscPanelChange( wxCommandEvent& event );
482 void OnDiscTypeChange( wxCommandEvent& event );
483 void OnDiscDeviceChange( wxCommandEvent& event );
485 /* Event handlers for the net page */
486 void OnNetPanelChangeSpin( wxSpinEvent& event );
487 void OnNetPanelChange( wxCommandEvent& event );
488 void OnNetTypeChange( wxCommandEvent& event );
490 /* Event handlers for the stream output */
491 void OnSubsFileEnable( wxCommandEvent& event );
492 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
494 /* Event handlers for the stream output */
495 void OnSoutEnable( wxCommandEvent& event );
496 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
498 /* Event handlers for the caching option */
499 void OnCachingEnable( wxCommandEvent& event );
500 void OnCachingChange( wxCommandEvent& event );
501 void OnCachingChangeSpin( wxSpinEvent& event );
503 DECLARE_EVENT_TABLE();
505 intf_thread_t *p_intf;
507 int i_current_access_method;
508 int i_disc_type_selection;
510 int i_method; /* Normal or for the stream dialog ? */
513 wxComboBox *mrl_combo;
514 wxNotebook *notebook;
516 /* Controls for the file panel */
517 wxComboBox *file_combo;
518 wxFileDialog *file_dialog;
520 /* Controls for the disc panel */
521 wxRadioBox *disc_type;
522 wxTextCtrl *disc_device;
523 wxSpinCtrl *disc_title; int i_disc_title;
524 wxSpinCtrl *disc_chapter; int i_disc_chapter;
525 wxSpinCtrl *disc_sub; int i_disc_sub;
526 wxSpinCtrl *disc_audio; int i_disc_audio;
528 /* The media equivalent name for a DVD names. For example,
529 * "Title", is "Track" for a CD-DA */
530 wxStaticText *disc_title_label;
531 wxStaticText *disc_chapter_label;
532 wxStaticText *disc_sub_label;
533 wxStaticText *disc_audio_label;
535 /* Indicates if the disc device control was modified */
536 bool b_disc_device_changed;
538 /* Controls for the net panel */
539 wxRadioBox *net_type;
541 wxPanel *net_subpanels[4];
542 wxRadioButton *net_radios[4];
543 wxSpinCtrl *net_ports[4];
545 wxTextCtrl *net_addrs[4];
546 wxCheckBox *net_timeshift;
547 wxCheckBox *net_ipv6;
549 /* Controls for the subtitles file */
550 wxButton *subsfile_button;
551 wxCheckBox *subsfile_checkbox;
552 SubsFileDialog *subsfile_dialog;
553 wxArrayString subsfile_mrl;
555 /* Controls for the stream output */
556 wxButton *sout_button;
557 wxCheckBox *sout_checkbox;
558 SoutDialog *sout_dialog;
559 wxArrayString sout_mrl;
561 /* Controls for the caching options */
562 wxCheckBox *caching_checkbox;
563 wxSpinCtrl *caching_value;
573 /* Auto-built panels */
576 #define MAX_ACCESS CAPTURE_ACCESS
578 /* Stream output Dialog */
591 TS_ENCAPSULATION = 0,
610 class SoutDialog: public wxDialog
614 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
615 virtual ~SoutDialog();
617 wxArrayString GetOptions();
621 wxPanel *AccessPanel( wxWindow* parent );
622 wxPanel *MiscPanel( wxWindow* parent );
623 wxPanel *EncapsulationPanel( wxWindow* parent );
624 wxPanel *TranscodingPanel( wxWindow* parent );
627 /* Event handlers (these functions should _not_ be virtual) */
628 void OnOk( wxCommandEvent& event );
629 void OnCancel( wxCommandEvent& event );
630 void OnMRLChange( wxCommandEvent& event );
631 void OnAccessTypeChange( wxCommandEvent& event );
633 /* Event handlers for the file access output */
634 void OnFileChange( wxCommandEvent& event );
635 void OnFileBrowse( wxCommandEvent& event );
636 void OnFileDump( wxCommandEvent& event );
638 /* Event handlers for the net access output */
639 void OnNetChange( wxCommandEvent& event );
641 /* Event specific to the announce address */
642 void OnAnnounceGroupChange( wxCommandEvent& event );
643 void OnAnnounceAddrChange( wxCommandEvent& event );
645 /* Event handlers for the encapsulation panel */
646 void OnEncapsulationChange( wxCommandEvent& event );
648 /* Event handlers for the transcoding panel */
649 void OnTranscodingEnable( wxCommandEvent& event );
650 void OnTranscodingChange( wxCommandEvent& event );
652 /* Event handlers for the misc panel */
653 void OnSAPMiscChange( wxCommandEvent& event );
654 void OnSLPMiscChange( wxCommandEvent& event );
656 DECLARE_EVENT_TABLE();
658 intf_thread_t *p_intf;
661 wxComboBox *mrl_combo;
663 /* Controls for the access outputs */
664 wxPanel *access_panel;
665 wxPanel *access_subpanels[ACCESS_OUT_NUM];
666 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
670 wxComboBox *file_combo;
671 wxCheckBox *dump_checkbox;
672 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
673 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
675 /* Controls for the SAP announces */
677 wxPanel *misc_subpanels[MISC_SOUT_NUM];
678 wxCheckBox *sap_checkbox;
679 wxCheckBox *slp_checkbox;
680 wxTextCtrl *announce_group;
681 wxTextCtrl *announce_addr;
683 /* Controls for the encapsulation */
684 wxPanel *encapsulation_panel;
685 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
686 int i_encapsulation_type;
688 /* Controls for transcoding */
689 wxPanel *transcoding_panel;
690 wxCheckBox *video_transc_checkbox;
691 wxComboBox *video_codec_combo;
692 wxComboBox *audio_codec_combo;
693 wxCheckBox *audio_transc_checkbox;
694 wxComboBox *video_bitrate_combo;
695 wxComboBox *audio_bitrate_combo;
696 wxComboBox *audio_channels_combo;
697 wxComboBox *video_scale_combo;
698 wxComboBox *subtitles_codec_combo;
699 wxCheckBox *subtitles_transc_checkbox;
700 wxCheckBox *subtitles_overlay_checkbox;
703 wxCheckBox *sout_all_checkbox;
706 /* Subtitles File Dialog */
707 class SubsFileDialog: public wxDialog
711 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
712 virtual ~SubsFileDialog();
714 wxComboBox *file_combo;
715 wxComboBox *encoding_combo;
716 wxComboBox *size_combo;
717 wxComboBox *align_combo;
718 wxSpinCtrl *fps_spinctrl;
719 wxSpinCtrl *delay_spinctrl;
722 /* Event handlers (these functions should _not_ be virtual) */
723 void OnOk( wxCommandEvent& event );
724 void OnCancel( wxCommandEvent& event );
725 void OnFileBrowse( wxCommandEvent& event );
727 DECLARE_EVENT_TABLE();
729 intf_thread_t *p_intf;
734 class StreamDialog: public wxFrame
738 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
739 virtual ~StreamDialog();
742 void OnClose( wxCommandEvent& event );
743 void OnOpen( wxCommandEvent& event );
744 void OnSout( wxCommandEvent& event );
745 void OnStart( wxCommandEvent& event );
747 DECLARE_EVENT_TABLE();
749 intf_thread_t *p_intf;
751 wxStaticText *step2_label;
752 wxStaticText *step3_label;
753 wxButton *sout_button;
754 wxButton *start_button;
756 wxArrayString sout_mrl;
757 OpenDialog *p_open_dialog;
758 SoutDialog *p_sout_dialog;
762 class WizardDialog : public wxWizard
766 WizardDialog( intf_thread_t *, wxWindow *p_parent, char *, int, int );
767 virtual ~WizardDialog();
768 void SetTranscode( char const *vcodec, int vb, char const *acodec, int ab);
769 void SetMrl( const char *mrl );
770 void SetTTL( int i_ttl );
771 void SetPartial( int, int );
772 void SetStream( char const *method, char const *address );
773 void SetTranscodeOut( char const *address );
774 void SetAction( int i_action );
776 void SetSAP( bool b_enabled, const char *psz_name );
777 void SetMux( char const *mux );
784 int i_from, i_to, i_ttl;
785 char *vcodec , *acodec , *address , *mrl , *mux ;
788 DECLARE_EVENT_TABLE();
790 intf_thread_t *p_intf;
794 /* Preferences Dialog */
795 class PrefsDialog: public wxFrame
799 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
800 virtual ~PrefsDialog();
803 wxPanel *PrefsPanel( wxWindow* parent );
805 /* Event handlers (these functions should _not_ be virtual) */
806 void OnOk( wxCommandEvent& event );
807 void OnCancel( wxCommandEvent& event );
808 void OnSave( wxCommandEvent& event );
809 void OnResetAll( wxCommandEvent& event );
810 void OnAdvanced( wxCommandEvent& event );
811 void OnClose( wxCloseEvent& event );
813 DECLARE_EVENT_TABLE();
815 intf_thread_t *p_intf;
817 PrefsTreeCtrl *prefs_tree;
821 class Messages: public wxFrame
825 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
827 bool Show( bool show = TRUE );
831 /* Event handlers (these functions should _not_ be virtual) */
832 void OnButtonClose( wxCommandEvent& event );
833 void OnClose( wxCloseEvent& WXUNUSED(event) );
834 void OnClear( wxCommandEvent& event );
835 void OnSaveLog( wxCommandEvent& event );
837 DECLARE_EVENT_TABLE();
839 intf_thread_t *p_intf;
840 wxTextCtrl *textctrl;
841 wxTextAttr *info_attr;
842 wxTextAttr *err_attr;
843 wxTextAttr *warn_attr;
844 wxTextAttr *dbg_attr;
846 wxFileDialog *save_log_dialog;
848 vlc_bool_t b_verbose;
852 class Playlist: public wxFrame
856 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
859 void UpdatePlaylist();
860 void ShowPlaylist( bool show );
861 void UpdateItem( int );
862 void AppendItem( wxCommandEvent& );
867 void RemoveItem( int );
868 void DeleteTreeItem( wxTreeItemId );
869 void DeleteItem( int item );
870 void DeleteNode( playlist_item_t *node );
872 void RecursiveDeleteSelection( wxTreeItemId );
874 /* Event handlers (these functions should _not_ be virtual) */
877 void OnAddFile( wxCommandEvent& event );
878 void OnAddDir( wxCommandEvent& event );
879 void OnAddMRL( wxCommandEvent& event );
880 void OnMenuClose( wxCommandEvent& event );
881 void OnClose( wxCloseEvent& WXUNUSED(event) );
883 void OnDeleteSelection( wxCommandEvent& event );
885 void OnOpen( wxCommandEvent& event );
886 void OnSave( wxCommandEvent& event );
889 void OnSearch( wxCommandEvent& event );
890 /*void OnSearchTextChange( wxCommandEvent& event );*/
891 wxTextCtrl *search_text;
892 wxButton *search_button;
893 wxTreeItemId search_current;
895 void OnEnDis( wxCommandEvent& event );
899 void OnSort( wxCommandEvent& event );
902 int i_duration_sorted;
905 void OnMenuEvent( wxCommandEvent& event );
906 void OnMenuOpen( wxMenuEvent& event );
912 void OnUp( wxCommandEvent& event);
913 void OnDown( wxCommandEvent& event);
915 void OnRandom( wxCommandEvent& event );
916 void OnRepeat( wxCommandEvent& event );
917 void OnLoop ( wxCommandEvent& event );
919 void OnActivateItem( wxTreeEvent& event );
920 void OnKeyDown( wxTreeEvent& event );
921 void OnNewGroup( wxCommandEvent& event );
926 wxTreeItemId i_wx_popup_item;
929 void OnPopup( wxContextMenuEvent& event );
930 void OnPopupPlay( wxCommandEvent& event );
931 void OnPopupPreparse( wxCommandEvent& event );
932 void OnPopupSort( wxCommandEvent& event );
933 void OnPopupDel( wxCommandEvent& event );
934 void OnPopupEna( wxCommandEvent& event );
935 void OnPopupInfo( wxCommandEvent& event );
936 void Rebuild( vlc_bool_t );
941 void UpdateNode( playlist_item_t*, wxTreeItemId );
942 void UpdateNodeChildren( playlist_item_t*, wxTreeItemId );
943 void CreateNode( playlist_item_t*, wxTreeItemId );
944 void UpdateTreeItem( wxTreeItemId );
946 /* Search (internal) */
947 int CountItems( wxTreeItemId);
948 wxTreeItemId FindItem( wxTreeItemId, int );
949 wxTreeItemId FindItemByName( wxTreeItemId, wxString,
950 wxTreeItemId, vlc_bool_t *);
952 wxTreeItemId saved_tree_item;
955 playlist_t *p_playlist;
959 void OnPlaylistEvent( wxCommandEvent& event );
961 DECLARE_EVENT_TABLE();
965 wxStatusBar *statusbar;
966 ItemInfoDialog *iteminfo_dialog;
968 int i_update_counter;
970 intf_thread_t *p_intf;
971 wxTreeCtrl *treectrl;
973 vlc_bool_t b_changed_view;
979 /* ItemInfo Dialog */
980 class ItemInfoDialog: public wxDialog
984 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
985 wxWindow *p_parent );
986 virtual ~ItemInfoDialog();
988 wxArrayString GetOptions();
991 wxPanel *InfoPanel( wxWindow* parent );
992 wxPanel *GroupPanel( wxWindow* parent );
994 /* Event handlers (these functions should _not_ be virtual) */
995 void OnOk( wxCommandEvent& event );
996 void OnCancel( wxCommandEvent& event );
1000 DECLARE_EVENT_TABLE();
1002 intf_thread_t *p_intf;
1003 playlist_item_t *p_item;
1006 /* Controls for the iteminfo dialog box */
1007 wxPanel *info_subpanel;
1008 wxPanel *info_panel;
1010 wxPanel *group_subpanel;
1011 wxPanel *group_panel;
1013 wxTextCtrl *uri_text;
1014 wxTextCtrl *name_text;
1016 wxTreeCtrl *info_tree;
1017 wxTreeItemId info_root;
1023 class FileInfo: public wxFrame
1027 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
1028 virtual ~FileInfo();
1029 void UpdateFileInfo();
1031 vlc_bool_t b_need_update;
1034 void OnButtonClose( wxCommandEvent& event );
1035 void OnClose( wxCloseEvent& WXUNUSED(event) );
1037 DECLARE_EVENT_TABLE();
1039 intf_thread_t *p_intf;
1040 wxTreeCtrl *fileinfo_tree;
1041 wxTreeItemId fileinfo_root;
1042 wxString fileinfo_root_label;
1046 #if wxUSE_DRAG_AND_DROP
1047 /* Drag and Drop class */
1048 class DragAndDrop: public wxFileDropTarget
1051 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
1053 virtual bool OnDropFiles( wxCoord x, wxCoord y,
1054 const wxArrayString& filenames );
1057 intf_thread_t *p_intf;
1058 vlc_bool_t b_enqueue;
1061 } // end of wxvlc namespace
1064 class WindowSettings
1067 WindowSettings( intf_thread_t *_p_intf );
1068 virtual ~WindowSettings();
1082 void SetSettings( int id, bool _b_shown,
1083 wxPoint p = wxDefaultPosition, wxSize s = wxDefaultSize );
1084 bool GetSettings( int id, bool& _b_shown, wxPoint& p, wxSize& s );
1086 void SetScreen( int i_screen_w, int i_screen_h );
1089 intf_thread_t *p_intf;
1093 bool b_valid[ID_MAX];
1094 bool b_shown[ID_MAX];
1095 wxPoint position[ID_MAX];
1096 wxSize size[ID_MAX];
1100 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
1101 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1102 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1103 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1104 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1108 class MenuEvtHandler : public wxEvtHandler
1111 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
1112 virtual ~MenuEvtHandler();
1114 void OnMenuEvent( wxCommandEvent& event );
1115 void OnShowDialog( wxCommandEvent& event );
1119 DECLARE_EVENT_TABLE()
1121 intf_thread_t *p_intf;
1122 Interface *p_main_interface;
1125 } // end of wxvlc namespace
1129 * wxWindows keeps dead locking because the timer tries to lock the playlist
1130 * when it's already locked somewhere else in the very wxWindows interface
1131 * module. Unless someone implements a "vlc_mutex_trylock", we need that.
1133 inline void LockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1135 if( p_sys->i_playlist_usage++ == 0)
1136 vlc_mutex_lock( &p_pl->object_lock );
1139 inline void UnlockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1141 if( --p_sys->i_playlist_usage == 0)
1142 vlc_mutex_unlock( &p_pl->object_lock );
1145 using namespace wxvlc;