1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999-2005 VideoLAN
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 wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
158 wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
165 class SubsFileDialog;
171 class ItemInfoDialog;
173 class ExportPlaylist;
175 /*****************************************************************************
176 * Classes declarations.
177 *****************************************************************************/
179 class Timer: public wxTimer
183 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
186 virtual void Notify();
189 //use wxWindow::IsShown instead
190 //vlc_bool_t b_slider_shown;
191 //vlc_bool_t b_disc_shown;
192 intf_thread_t *p_intf;
193 Interface *p_main_interface;
195 int i_old_playing_status;
201 class ExtraPanel: public wxPanel
205 ExtraPanel( intf_thread_t *p_intf, wxWindow *p_parent );
206 virtual ~ExtraPanel();
208 wxStaticBox *adjust_box;
209 wxButton *restoredefaults_button;
210 wxSlider *brightness_slider;
211 wxSlider *contrast_slider;
212 wxSlider *saturation_slider;
213 wxSlider *hue_slider;
214 wxSlider *gamma_slider;
216 wxStaticBox *other_box;
217 wxComboBox *ratio_combo;
225 wxPanel *VideoPanel( wxWindow * );
226 wxPanel *EqzPanel( wxWindow * );
227 wxPanel *AudioPanel( wxWindow * );
229 wxNotebook *notebook;
231 wxCheckBox *eq_chkbox;
233 wxCheckBox *eq_2p_chkbox;
235 wxSlider *smooth_slider;
237 wxSlider *preamp_slider;
238 wxStaticText * preamp_text;
243 wxSlider *band_sliders[10];
244 wxStaticText *band_texts[10];
250 /* Event handlers (these functions should _not_ be virtual) */
252 void OnEnableAdjust( wxCommandEvent& );
253 void OnEnableEqualizer( wxCommandEvent& );
254 void OnRestoreDefaults( wxCommandEvent& );
255 void OnChangeEqualizer( wxScrollEvent& );
256 void OnAdjustUpdate( wxScrollEvent& );
257 void OnRatio( wxCommandEvent& );
258 void OnFiltersInfo( wxCommandEvent& );
259 void OnSelectFilter( wxCommandEvent& );
261 void OnEqSmooth( wxScrollEvent& );
262 void OnPreamp( wxScrollEvent& );
263 void OnEq2Pass( wxCommandEvent& );
264 void OnEqRestore( wxCommandEvent& );
266 void OnHeadphone( wxCommandEvent& );
267 void OnNormvol( wxCommandEvent& );
268 void OnNormvolSlider( wxScrollEvent& );
270 void OnIdle( wxIdleEvent& );
272 DECLARE_EVENT_TABLE();
274 intf_thread_t *p_intf;
275 vlc_bool_t b_my_update;
279 /* Extended Window */
280 class ExtraWindow: public wxFrame
284 ExtraWindow( intf_thread_t *p_intf, wxWindow *p_parent, wxPanel *panel );
285 virtual ~ExtraWindow();
291 DECLARE_EVENT_TABLE();
293 intf_thread_t *p_intf;
297 /* Systray integration */
298 #ifdef wxHAS_TASK_BAR_ICON
299 class Systray: public wxTaskBarIcon
302 Systray( Interface* p_main_interface, intf_thread_t *p_intf );
303 virtual ~Systray() {};
304 wxMenu* CreatePopupMenu();
305 void UpdateTooltip( const wxChar* tooltip );
308 void OnMenuIconize( wxCommandEvent& event );
309 void OnLeftClick( wxTaskBarIconEvent& event );
310 void OnPlayStream ( wxCommandEvent& event );
311 void OnStopStream ( wxCommandEvent& event );
312 void OnPrevStream ( wxCommandEvent& event );
313 void OnNextStream ( wxCommandEvent& event );
314 void OnExit( wxCommandEvent& event );
315 Interface* p_main_interface;
316 intf_thread_t *p_intf;
317 DECLARE_EVENT_TABLE()
322 class Interface: public wxFrame
326 Interface( intf_thread_t *p_intf, long style = wxDEFAULT_FRAME_STYLE );
327 virtual ~Interface();
329 void TogglePlayButton( int i_playing_status );
336 wxBoxSizer *frame_sizer;
337 wxStatusBar *statusbar;
339 void HideSlider(bool layout = true);
340 void ShowSlider(bool show = true, bool layout = true);
343 wxWindow *slider_frame;
344 wxBoxSizer *slider_sizer;
345 wxPanel *extra_frame;
347 void HideDiscFrame(bool layout = true);
348 void ShowDiscFrame(bool show = true, bool layout = true);
351 wxBoxSizer *disc_sizer;
352 wxBitmapButton *disc_menu_button;
353 wxBitmapButton *disc_prev_button;
354 wxBitmapButton *disc_next_button;
356 wxFrame *extra_window;
363 #ifdef wxHAS_TASK_BAR_ICON
367 wxTimer m_controls_timer;
368 wxTimer m_slider_timer;
372 void CreateOurMenuBar();
373 void CreateOurToolBar();
374 void CreateOurExtendedPanel();
375 void CreateOurSlider();
376 void Open( int i_access_method );
378 /* Event handlers (these functions should _not_ be virtual) */
379 void OnControlsTimer(wxTimerEvent& WXUNUSED(event));
380 void OnSliderTimer(wxTimerEvent& WXUNUSED(event));
382 void OnExit( wxCommandEvent& event );
383 void OnAbout( wxCommandEvent& event );
385 void OnOpenFileSimple( wxCommandEvent& event );
386 void OnOpenDir( wxCommandEvent& event );
387 void OnOpenFile( wxCommandEvent& event );
388 void OnOpenDisc( wxCommandEvent& event );
389 void OnOpenNet( wxCommandEvent& event );
390 void OnOpenSat( wxCommandEvent& event );
392 void OnExtended( wxCommandEvent& event );
393 //void OnUndock( wxCommandEvent& event );
395 void OnBookmarks( wxCommandEvent& event );
396 void OnShowDialog( wxCommandEvent& event );
397 void OnPlayStream( wxCommandEvent& event );
398 void OnStopStream( wxCommandEvent& event );
399 void OnSliderUpdate( wxScrollEvent& event );
400 void OnPrevStream( wxCommandEvent& event );
401 void OnNextStream( wxCommandEvent& event );
402 void OnSlowStream( wxCommandEvent& event );
403 void OnFastStream( wxCommandEvent& event );
405 void OnDiscMenu( wxCommandEvent& event );
406 void OnDiscPrev( wxCommandEvent& event );
407 void OnDiscNext( wxCommandEvent& event );
409 void OnMenuOpen( wxMenuEvent& event );
411 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
412 void OnContextMenu2(wxContextMenuEvent& event);
414 void OnContextMenu(wxMouseEvent& event);
416 void OnControlEvent( wxCommandEvent& event );
418 DECLARE_EVENT_TABLE();
421 intf_thread_t *p_intf;
424 int i_old_playing_status;
426 /* For auto-generated menus */
427 wxMenu *p_settings_menu;
428 wxMenu *p_audio_menu;
429 wxMenu *p_video_menu;
430 wxMenu *p_navig_menu;
434 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
435 class OpenDialog: public wxDialog
439 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
440 int i_access_method, int i_arg = 0 );
442 /* Extended Contructor */
443 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
444 int i_access_method, int i_arg = 0 , int _i_method = 0 );
445 virtual ~OpenDialog();
448 int Show( int i_access_method, int i_arg = 0 );
451 void UpdateMRL( int i_access_method );
456 wxPanel *FilePanel( wxWindow* parent );
457 wxPanel *DiscPanel( wxWindow* parent );
458 wxPanel *NetPanel( wxWindow* parent );
460 ArrayOfAutoBuiltPanel input_tab_array;
462 /* Event handlers (these functions should _not_ be virtual) */
463 void OnOk( wxCommandEvent& event );
464 void OnCancel( wxCommandEvent& event );
465 void OnClose( wxCloseEvent& event );
467 void OnPageChange( wxNotebookEvent& event );
468 void OnMRLChange( wxCommandEvent& event );
470 /* Event handlers for the file page */
471 void OnFilePanelChange( wxCommandEvent& event );
472 void OnFileBrowse( wxCommandEvent& event );
474 /* Event handlers for the disc page */
475 void OnDiscPanelChangeSpin( wxSpinEvent& event );
476 void OnDiscPanelChange( wxCommandEvent& event );
477 void OnDiscTypeChange( wxCommandEvent& event );
478 void OnDiscDeviceChange( wxCommandEvent& event );
480 /* Event handlers for the net page */
481 void OnNetPanelChangeSpin( wxSpinEvent& event );
482 void OnNetPanelChange( wxCommandEvent& event );
483 void OnNetTypeChange( wxCommandEvent& event );
485 /* Event handlers for the stream output */
486 void OnSubsFileEnable( wxCommandEvent& event );
487 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
489 /* Event handlers for the stream output */
490 void OnSoutEnable( wxCommandEvent& event );
491 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
493 /* Event handlers for the caching option */
494 void OnCachingEnable( wxCommandEvent& event );
495 void OnCachingChange( wxCommandEvent& event );
496 void OnCachingChangeSpin( wxSpinEvent& event );
498 DECLARE_EVENT_TABLE();
500 intf_thread_t *p_intf;
502 int i_current_access_method;
503 int i_disc_type_selection;
505 int i_method; /* Normal or for the stream dialog ? */
508 wxComboBox *mrl_combo;
509 wxNotebook *notebook;
511 /* Controls for the file panel */
512 wxComboBox *file_combo;
513 wxFileDialog *file_dialog;
515 /* Controls for the disc panel */
516 wxRadioBox *disc_type;
517 wxTextCtrl *disc_device;
518 wxSpinCtrl *disc_title; int i_disc_title;
519 wxSpinCtrl *disc_chapter; int i_disc_chapter;
520 wxSpinCtrl *disc_sub; int i_disc_sub;
522 /* The media equivalent name for a DVD names. For example,
523 * "Title", is "Track" for a CD-DA */
524 wxStaticText *disc_title_label;
525 wxStaticText *disc_chapter_label;
526 wxStaticText *disc_sub_label;
528 /* Indicates if the disc device control was modified */
529 bool b_disc_device_changed;
531 /* Controls for the net panel */
532 wxRadioBox *net_type;
534 wxPanel *net_subpanels[4];
535 wxRadioButton *net_radios[4];
536 wxSpinCtrl *net_ports[4];
538 wxTextCtrl *net_addrs[4];
539 wxCheckBox *net_timeshift;
540 wxCheckBox *net_ipv6;
542 /* Controls for the subtitles file */
543 wxButton *subsfile_button;
544 wxCheckBox *subsfile_checkbox;
545 SubsFileDialog *subsfile_dialog;
546 wxArrayString subsfile_mrl;
548 /* Controls for the stream output */
549 wxButton *sout_button;
550 wxCheckBox *sout_checkbox;
551 SoutDialog *sout_dialog;
552 wxArrayString sout_mrl;
554 /* Controls for the caching options */
555 wxCheckBox *caching_checkbox;
556 wxSpinCtrl *caching_value;
566 /* Auto-built panels */
569 #define MAX_ACCESS CAPTURE_ACCESS
571 /* Stream output Dialog */
584 TS_ENCAPSULATION = 0,
603 class SoutDialog: public wxDialog
607 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
608 virtual ~SoutDialog();
610 wxArrayString GetOptions();
614 wxPanel *AccessPanel( wxWindow* parent );
615 wxPanel *MiscPanel( wxWindow* parent );
616 wxPanel *EncapsulationPanel( wxWindow* parent );
617 wxPanel *TranscodingPanel( wxWindow* parent );
620 /* Event handlers (these functions should _not_ be virtual) */
621 void OnOk( wxCommandEvent& event );
622 void OnCancel( wxCommandEvent& event );
623 void OnMRLChange( wxCommandEvent& event );
624 void OnAccessTypeChange( wxCommandEvent& event );
626 /* Event handlers for the file access output */
627 void OnFileChange( wxCommandEvent& event );
628 void OnFileBrowse( wxCommandEvent& event );
629 void OnFileDump( wxCommandEvent& event );
631 /* Event handlers for the net access output */
632 void OnNetChange( wxCommandEvent& event );
634 /* Event specific to the announce address */
635 void OnAnnounceGroupChange( wxCommandEvent& event );
636 void OnAnnounceAddrChange( wxCommandEvent& event );
638 /* Event handlers for the encapsulation panel */
639 void OnEncapsulationChange( wxCommandEvent& event );
641 /* Event handlers for the transcoding panel */
642 void OnTranscodingEnable( wxCommandEvent& event );
643 void OnTranscodingChange( wxCommandEvent& event );
645 /* Event handlers for the misc panel */
646 void OnSAPMiscChange( wxCommandEvent& event );
647 void OnSLPMiscChange( wxCommandEvent& event );
649 DECLARE_EVENT_TABLE();
651 intf_thread_t *p_intf;
654 wxComboBox *mrl_combo;
656 /* Controls for the access outputs */
657 wxPanel *access_panel;
658 wxPanel *access_subpanels[ACCESS_OUT_NUM];
659 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
663 wxComboBox *file_combo;
664 wxCheckBox *dump_checkbox;
665 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
666 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
668 /* Controls for the SAP announces */
670 wxPanel *misc_subpanels[MISC_SOUT_NUM];
671 wxCheckBox *sap_checkbox;
672 wxCheckBox *slp_checkbox;
673 wxTextCtrl *announce_group;
674 wxTextCtrl *announce_addr;
676 /* Controls for the encapsulation */
677 wxPanel *encapsulation_panel;
678 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
679 int i_encapsulation_type;
681 /* Controls for transcoding */
682 wxPanel *transcoding_panel;
683 wxCheckBox *video_transc_checkbox;
684 wxComboBox *video_codec_combo;
685 wxComboBox *audio_codec_combo;
686 wxCheckBox *audio_transc_checkbox;
687 wxComboBox *video_bitrate_combo;
688 wxComboBox *audio_bitrate_combo;
689 wxComboBox *audio_channels_combo;
690 wxComboBox *video_scale_combo;
691 wxComboBox *subtitles_codec_combo;
692 wxCheckBox *subtitles_transc_checkbox;
693 wxCheckBox *subtitles_overlay_checkbox;
696 wxCheckBox *sout_all_checkbox;
699 /* Subtitles File Dialog */
700 class SubsFileDialog: public wxDialog
704 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
705 virtual ~SubsFileDialog();
707 wxComboBox *file_combo;
708 wxComboBox *encoding_combo;
709 wxComboBox *size_combo;
710 wxComboBox *align_combo;
711 wxSpinCtrl *fps_spinctrl;
712 wxSpinCtrl *delay_spinctrl;
715 /* Event handlers (these functions should _not_ be virtual) */
716 void OnOk( wxCommandEvent& event );
717 void OnCancel( wxCommandEvent& event );
718 void OnFileBrowse( wxCommandEvent& event );
720 DECLARE_EVENT_TABLE();
722 intf_thread_t *p_intf;
727 class StreamDialog: public wxFrame
731 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
732 virtual ~StreamDialog();
735 void OnClose( wxCommandEvent& event );
736 void OnOpen( wxCommandEvent& event );
737 void OnSout( wxCommandEvent& event );
738 void OnStart( wxCommandEvent& event );
740 DECLARE_EVENT_TABLE();
742 intf_thread_t *p_intf;
744 wxStaticText *step2_label;
745 wxStaticText *step3_label;
746 wxButton *sout_button;
747 wxButton *start_button;
749 wxArrayString sout_mrl;
750 OpenDialog *p_open_dialog;
751 SoutDialog *p_sout_dialog;
755 class WizardDialog : public wxWizard
759 WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent,char *, int, int );
760 virtual ~WizardDialog();
761 void SetTranscode( char *vcodec, int vb, char *acodec,int ab);
762 void SetMrl( const char *mrl );
763 void SetTTL( int i_ttl );
764 void SetPartial( int, int );
765 void SetStream( char *method, char *address );
766 void SetTranscodeOut( const char *address );
767 void SetAction( int i_action );
769 void SetSAP( bool b_enabled, const char *psz_name );
770 void SetMux( char *mux );
777 int i_from, i_to, i_ttl;
778 char *vcodec , *acodec , *address , *mrl , *mux ;
781 DECLARE_EVENT_TABLE();
783 intf_thread_t *p_intf;
787 /* Preferences Dialog */
788 class PrefsDialog: public wxFrame
792 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
793 virtual ~PrefsDialog();
796 wxPanel *PrefsPanel( wxWindow* parent );
798 /* Event handlers (these functions should _not_ be virtual) */
799 void OnOk( wxCommandEvent& event );
800 void OnCancel( wxCommandEvent& event );
801 void OnSave( wxCommandEvent& event );
802 void OnResetAll( wxCommandEvent& event );
803 void OnAdvanced( wxCommandEvent& event );
804 void OnClose( wxCloseEvent& event );
806 DECLARE_EVENT_TABLE();
808 intf_thread_t *p_intf;
810 PrefsTreeCtrl *prefs_tree;
814 class Messages: public wxFrame
818 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
820 bool Show( bool show = TRUE );
824 /* Event handlers (these functions should _not_ be virtual) */
825 void OnButtonClose( wxCommandEvent& event );
826 void OnClose( wxCloseEvent& WXUNUSED(event) );
827 void OnClear( wxCommandEvent& event );
828 void OnSaveLog( wxCommandEvent& event );
830 DECLARE_EVENT_TABLE();
832 intf_thread_t *p_intf;
833 wxTextCtrl *textctrl;
834 wxTextAttr *info_attr;
835 wxTextAttr *err_attr;
836 wxTextAttr *warn_attr;
837 wxTextAttr *dbg_attr;
839 wxFileDialog *save_log_dialog;
841 vlc_bool_t b_verbose;
845 class Playlist: public wxFrame
849 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
852 void UpdatePlaylist();
853 void ShowPlaylist( bool show );
854 void UpdateItem( int );
855 void AppendItem( wxCommandEvent& );
860 void RemoveItem( int );
861 void DeleteItem( int item );
862 void DeleteNode( playlist_item_t *node );
864 /* Event handlers (these functions should _not_ be virtual) */
867 void OnAddFile( wxCommandEvent& event );
868 void OnAddDir( wxCommandEvent& event );
869 void OnAddMRL( wxCommandEvent& event );
870 void OnMenuClose( wxCommandEvent& event );
871 void OnClose( wxCloseEvent& WXUNUSED(event) );
873 void OnEnableSelection( wxCommandEvent& event );
874 void OnDisableSelection( wxCommandEvent& event );
875 void OnInvertSelection( wxCommandEvent& event );
876 void OnDeleteSelection( wxCommandEvent& event );
877 void OnSelectAll( wxCommandEvent& event );
879 void OnOpen( wxCommandEvent& event );
880 void OnSave( wxCommandEvent& event );
883 void OnSearch( wxCommandEvent& event );
884 void OnSearchTextChange( wxCommandEvent& event );
885 wxTextCtrl *search_text;
886 wxButton *search_button;
887 wxTreeItemId search_current;
889 void OnEnDis( wxCommandEvent& event );
893 void OnSort( wxCommandEvent& event );
896 int i_duration_sorted;
899 void OnMenuEvent( wxCommandEvent& event );
900 void OnMenuOpen( wxMenuEvent& event );
906 void OnUp( wxCommandEvent& event);
907 void OnDown( wxCommandEvent& event);
909 void OnRandom( wxCommandEvent& event );
910 void OnRepeat( wxCommandEvent& event );
911 void OnLoop ( wxCommandEvent& event );
913 void OnActivateItem( wxTreeEvent& event );
914 void OnKeyDown( wxTreeEvent& event );
915 void OnNewGroup( wxCommandEvent& event );
920 wxTreeItemId i_wx_popup_item;
923 void OnPopup( wxContextMenuEvent& event );
924 void OnPopupPlay( wxCommandEvent& event );
925 void OnPopupPreparse( wxCommandEvent& event );
926 void OnPopupSort( wxCommandEvent& event );
927 void OnPopupDel( wxCommandEvent& event );
928 void OnPopupEna( wxCommandEvent& event );
929 void OnPopupInfo( wxCommandEvent& event );
930 void Rebuild( vlc_bool_t );
935 void UpdateNode( playlist_item_t*, wxTreeItemId );
936 void UpdateNodeChildren( playlist_item_t*, wxTreeItemId );
937 void CreateNode( playlist_item_t*, wxTreeItemId );
938 void UpdateTreeItem( wxTreeItemId );
940 /* Search (internal) */
941 int CountItems( wxTreeItemId);
942 wxTreeItemId FindItem( wxTreeItemId, int );
943 wxTreeItemId FindItemByName( wxTreeItemId, wxString,
944 wxTreeItemId, vlc_bool_t *);
946 wxTreeItemId saved_tree_item;
949 playlist_t *p_playlist;
953 void OnPlaylistEvent( wxCommandEvent& event );
955 DECLARE_EVENT_TABLE();
959 wxStatusBar *statusbar;
960 ItemInfoDialog *iteminfo_dialog;
962 int i_update_counter;
964 intf_thread_t *p_intf;
965 wxTreeCtrl *treectrl;
967 vlc_bool_t b_changed_view;
973 /* ItemInfo Dialog */
974 class ItemInfoDialog: public wxDialog
978 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
979 wxWindow *p_parent );
980 virtual ~ItemInfoDialog();
982 wxArrayString GetOptions();
985 wxPanel *InfoPanel( wxWindow* parent );
986 wxPanel *GroupPanel( wxWindow* parent );
988 /* Event handlers (these functions should _not_ be virtual) */
989 void OnOk( wxCommandEvent& event );
990 void OnCancel( wxCommandEvent& event );
994 DECLARE_EVENT_TABLE();
996 intf_thread_t *p_intf;
997 playlist_item_t *p_item;
1000 /* Controls for the iteminfo dialog box */
1001 wxPanel *info_subpanel;
1002 wxPanel *info_panel;
1004 wxPanel *group_subpanel;
1005 wxPanel *group_panel;
1007 wxTextCtrl *uri_text;
1008 wxTextCtrl *name_text;
1010 wxTreeCtrl *info_tree;
1011 wxTreeItemId info_root;
1017 class FileInfo: public wxFrame
1021 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
1022 virtual ~FileInfo();
1023 void UpdateFileInfo();
1025 vlc_bool_t b_need_update;
1028 void OnButtonClose( wxCommandEvent& event );
1029 void OnClose( wxCloseEvent& WXUNUSED(event) );
1031 DECLARE_EVENT_TABLE();
1033 intf_thread_t *p_intf;
1034 wxTreeCtrl *fileinfo_tree;
1035 wxTreeItemId fileinfo_root;
1036 wxString fileinfo_root_label;
1040 #if wxUSE_DRAG_AND_DROP
1041 /* Drag and Drop class */
1042 class DragAndDrop: public wxFileDropTarget
1045 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
1047 virtual bool OnDropFiles( wxCoord x, wxCoord y,
1048 const wxArrayString& filenames );
1051 intf_thread_t *p_intf;
1052 vlc_bool_t b_enqueue;
1055 } // end of wxvlc namespace
1058 class WindowSettings
1061 WindowSettings( intf_thread_t *_p_intf );
1062 virtual ~WindowSettings();
1075 void SetSettings( int id, bool _b_shown,
1076 wxPoint p = wxDefaultPosition, wxSize s = wxDefaultSize );
1077 bool GetSettings( int id, bool& _b_shown, wxPoint& p, wxSize& s );
1079 void SetScreen( int i_screen_w, int i_screen_h );
1082 intf_thread_t *p_intf;
1086 bool b_valid[ID_MAX];
1087 bool b_shown[ID_MAX];
1088 wxPoint position[ID_MAX];
1089 wxSize size[ID_MAX];
1093 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
1094 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1095 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1096 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1097 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1101 class MenuEvtHandler : public wxEvtHandler
1104 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
1105 virtual ~MenuEvtHandler();
1107 void OnMenuEvent( wxCommandEvent& event );
1108 void OnShowDialog( wxCommandEvent& event );
1112 DECLARE_EVENT_TABLE()
1114 intf_thread_t *p_intf;
1115 Interface *p_main_interface;
1118 } // end of wxvlc namespace
1122 * wxWindows keeps dead locking because the timer tries to lock the playlist
1123 * when it's already locked somewhere else in the very wxWindows interface
1124 * module. Unless someone implements a "vlc_mutex_trylock", we need that.
1126 inline void LockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1128 if( p_sys->i_playlist_usage++ == 0)
1129 vlc_mutex_lock( &p_pl->object_lock );
1132 inline void UnlockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1134 if( --p_sys->i_playlist_usage == 0)
1135 vlc_mutex_unlock( &p_pl->object_lock );
1138 using namespace wxvlc;