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 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 wxSlider *smooth_slider;
238 wxSlider *preamp_slider;
239 wxStaticText * preamp_text;
244 wxSlider *band_sliders[10];
245 wxStaticText *band_texts[10];
251 /* Event handlers (these functions should _not_ be virtual) */
253 void OnEnableAdjust( wxCommandEvent& );
254 void OnEnableEqualizer( wxCommandEvent& );
255 void OnRestoreDefaults( wxCommandEvent& );
256 void OnChangeEqualizer( wxScrollEvent& );
257 void OnAdjustUpdate( wxScrollEvent& );
258 void OnRatio( wxCommandEvent& );
259 void OnFiltersInfo( wxCommandEvent& );
260 void OnSelectFilter( wxCommandEvent& );
262 void OnEqSmooth( wxScrollEvent& );
263 void OnPreamp( wxScrollEvent& );
264 void OnEq2Pass( wxCommandEvent& );
265 void OnEqRestore( wxCommandEvent& );
267 void OnHeadphone( wxCommandEvent& );
268 void OnNormvol( wxCommandEvent& );
269 void OnNormvolSlider( wxScrollEvent& );
271 void OnIdle( wxIdleEvent& );
273 DECLARE_EVENT_TABLE();
275 intf_thread_t *p_intf;
276 vlc_bool_t b_my_update;
280 /* Extended Window */
281 class ExtraWindow: public wxFrame
285 ExtraWindow( intf_thread_t *p_intf, wxWindow *p_parent, wxPanel *panel );
286 virtual ~ExtraWindow();
292 DECLARE_EVENT_TABLE();
294 intf_thread_t *p_intf;
298 /* Systray integration */
299 #ifdef wxHAS_TASK_BAR_ICON
300 class Systray: public wxTaskBarIcon
303 Systray( Interface* p_main_interface, intf_thread_t *p_intf );
304 virtual ~Systray() {};
305 wxMenu* CreatePopupMenu();
306 void UpdateTooltip( const wxChar* tooltip );
309 void OnMenuIconize( wxCommandEvent& event );
310 void OnLeftClick( wxTaskBarIconEvent& event );
311 void OnPlayStream ( wxCommandEvent& event );
312 void OnStopStream ( wxCommandEvent& event );
313 void OnPrevStream ( wxCommandEvent& event );
314 void OnNextStream ( wxCommandEvent& event );
315 void OnExit( wxCommandEvent& event );
316 Interface* p_main_interface;
317 intf_thread_t *p_intf;
318 DECLARE_EVENT_TABLE()
323 class Interface: public wxFrame
327 Interface( intf_thread_t *p_intf, long style = wxDEFAULT_FRAME_STYLE );
328 virtual ~Interface();
330 void TogglePlayButton( int i_playing_status );
337 wxBoxSizer *frame_sizer;
338 wxStatusBar *statusbar;
340 void HideSlider(bool layout = true);
341 void ShowSlider(bool show = true, bool layout = true);
344 wxWindow *slider_frame;
345 wxBoxSizer *slider_sizer;
346 wxPanel *extra_frame;
348 void HideDiscFrame(bool layout = true);
349 void ShowDiscFrame(bool show = true, bool layout = true);
352 wxBoxSizer *disc_sizer;
353 wxBitmapButton *disc_menu_button;
354 wxBitmapButton *disc_prev_button;
355 wxBitmapButton *disc_next_button;
357 wxFrame *extra_window;
364 #ifdef wxHAS_TASK_BAR_ICON
368 wxTimer m_controls_timer;
369 wxTimer m_slider_timer;
373 void CreateOurMenuBar();
374 void CreateOurToolBar();
375 void CreateOurExtendedPanel();
376 void CreateOurSlider();
377 void Open( int i_access_method );
379 /* Event handlers (these functions should _not_ be virtual) */
380 void OnControlsTimer(wxTimerEvent& WXUNUSED(event));
381 void OnSliderTimer(wxTimerEvent& WXUNUSED(event));
383 void OnExit( wxCommandEvent& event );
384 void OnAbout( wxCommandEvent& event );
386 void OnOpenFileSimple( wxCommandEvent& event );
387 void OnOpenDir( wxCommandEvent& event );
388 void OnOpenFile( wxCommandEvent& event );
389 void OnOpenDisc( wxCommandEvent& event );
390 void OnOpenNet( wxCommandEvent& event );
391 void OnOpenSat( wxCommandEvent& event );
393 void OnExtended( wxCommandEvent& event );
394 //void OnUndock( wxCommandEvent& event );
396 void OnBookmarks( wxCommandEvent& event );
397 void OnShowDialog( wxCommandEvent& event );
398 void OnPlayStream( wxCommandEvent& event );
399 void OnStopStream( wxCommandEvent& event );
400 void OnSliderUpdate( wxScrollEvent& event );
401 void OnPrevStream( wxCommandEvent& event );
402 void OnNextStream( wxCommandEvent& event );
403 void OnSlowStream( wxCommandEvent& event );
404 void OnFastStream( wxCommandEvent& event );
406 void OnDiscMenu( wxCommandEvent& event );
407 void OnDiscPrev( wxCommandEvent& event );
408 void OnDiscNext( wxCommandEvent& event );
410 void OnMenuOpen( wxMenuEvent& event );
412 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
413 void OnContextMenu2(wxContextMenuEvent& event);
415 void OnContextMenu(wxMouseEvent& event);
417 void OnControlEvent( wxCommandEvent& event );
419 DECLARE_EVENT_TABLE();
422 intf_thread_t *p_intf;
424 wxWindow *video_window;
426 int i_old_playing_status;
428 /* For auto-generated menus */
429 wxMenu *p_settings_menu;
430 wxMenu *p_audio_menu;
431 wxMenu *p_video_menu;
432 wxMenu *p_navig_menu;
436 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
437 class OpenDialog: public wxDialog
441 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
442 int i_access_method, int i_arg = 0 );
444 /* Extended Contructor */
445 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
446 int i_access_method, int i_arg = 0 , int _i_method = 0 );
447 virtual ~OpenDialog();
450 int Show( int i_access_method, int i_arg = 0 );
453 void UpdateMRL( int i_access_method );
458 wxPanel *FilePanel( wxWindow* parent );
459 wxPanel *DiscPanel( wxWindow* parent );
460 wxPanel *NetPanel( wxWindow* parent );
462 ArrayOfAutoBuiltPanel input_tab_array;
464 /* Event handlers (these functions should _not_ be virtual) */
465 void OnOk( wxCommandEvent& event );
466 void OnCancel( wxCommandEvent& event );
467 void OnClose( wxCloseEvent& event );
469 void OnPageChange( wxNotebookEvent& event );
470 void OnMRLChange( wxCommandEvent& event );
472 /* Event handlers for the file page */
473 void OnFilePanelChange( wxCommandEvent& event );
474 void OnFileBrowse( wxCommandEvent& event );
476 /* Event handlers for the disc page */
477 void OnDiscPanelChangeSpin( wxSpinEvent& event );
478 void OnDiscPanelChange( wxCommandEvent& event );
479 void OnDiscTypeChange( wxCommandEvent& event );
480 void OnDiscDeviceChange( wxCommandEvent& event );
482 /* Event handlers for the net page */
483 void OnNetPanelChangeSpin( wxSpinEvent& event );
484 void OnNetPanelChange( wxCommandEvent& event );
485 void OnNetTypeChange( wxCommandEvent& event );
487 /* Event handlers for the stream output */
488 void OnSubsFileEnable( wxCommandEvent& event );
489 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
491 /* Event handlers for the stream output */
492 void OnSoutEnable( wxCommandEvent& event );
493 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
495 /* Event handlers for the caching option */
496 void OnCachingEnable( wxCommandEvent& event );
497 void OnCachingChange( wxCommandEvent& event );
498 void OnCachingChangeSpin( wxSpinEvent& event );
500 DECLARE_EVENT_TABLE();
502 intf_thread_t *p_intf;
504 int i_current_access_method;
505 int i_disc_type_selection;
507 int i_method; /* Normal or for the stream dialog ? */
510 wxComboBox *mrl_combo;
511 wxNotebook *notebook;
513 /* Controls for the file panel */
514 wxComboBox *file_combo;
515 wxFileDialog *file_dialog;
517 /* Controls for the disc panel */
518 wxRadioBox *disc_type;
519 wxTextCtrl *disc_device;
520 wxSpinCtrl *disc_title; int i_disc_title;
521 wxSpinCtrl *disc_chapter; int i_disc_chapter;
522 wxSpinCtrl *disc_sub; int i_disc_sub;
524 /* The media equivalent name for a DVD names. For example,
525 * "Title", is "Track" for a CD-DA */
526 wxStaticText *disc_title_label;
527 wxStaticText *disc_chapter_label;
528 wxStaticText *disc_sub_label;
530 /* Indicates if the disc device control was modified */
531 bool b_disc_device_changed;
533 /* Controls for the net panel */
534 wxRadioBox *net_type;
536 wxPanel *net_subpanels[4];
537 wxRadioButton *net_radios[4];
538 wxSpinCtrl *net_ports[4];
540 wxTextCtrl *net_addrs[4];
541 wxCheckBox *net_timeshift;
542 wxCheckBox *net_ipv6;
544 /* Controls for the subtitles file */
545 wxButton *subsfile_button;
546 wxCheckBox *subsfile_checkbox;
547 SubsFileDialog *subsfile_dialog;
548 wxArrayString subsfile_mrl;
550 /* Controls for the stream output */
551 wxButton *sout_button;
552 wxCheckBox *sout_checkbox;
553 SoutDialog *sout_dialog;
554 wxArrayString sout_mrl;
556 /* Controls for the caching options */
557 wxCheckBox *caching_checkbox;
558 wxSpinCtrl *caching_value;
568 /* Auto-built panels */
571 #define MAX_ACCESS CAPTURE_ACCESS
573 /* Stream output Dialog */
586 TS_ENCAPSULATION = 0,
605 class SoutDialog: public wxDialog
609 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
610 virtual ~SoutDialog();
612 wxArrayString GetOptions();
616 wxPanel *AccessPanel( wxWindow* parent );
617 wxPanel *MiscPanel( wxWindow* parent );
618 wxPanel *EncapsulationPanel( wxWindow* parent );
619 wxPanel *TranscodingPanel( wxWindow* parent );
622 /* Event handlers (these functions should _not_ be virtual) */
623 void OnOk( wxCommandEvent& event );
624 void OnCancel( wxCommandEvent& event );
625 void OnMRLChange( wxCommandEvent& event );
626 void OnAccessTypeChange( wxCommandEvent& event );
628 /* Event handlers for the file access output */
629 void OnFileChange( wxCommandEvent& event );
630 void OnFileBrowse( wxCommandEvent& event );
631 void OnFileDump( wxCommandEvent& event );
633 /* Event handlers for the net access output */
634 void OnNetChange( wxCommandEvent& event );
636 /* Event specific to the announce address */
637 void OnAnnounceGroupChange( wxCommandEvent& event );
638 void OnAnnounceAddrChange( wxCommandEvent& event );
640 /* Event handlers for the encapsulation panel */
641 void OnEncapsulationChange( wxCommandEvent& event );
643 /* Event handlers for the transcoding panel */
644 void OnTranscodingEnable( wxCommandEvent& event );
645 void OnTranscodingChange( wxCommandEvent& event );
647 /* Event handlers for the misc panel */
648 void OnSAPMiscChange( wxCommandEvent& event );
649 void OnSLPMiscChange( wxCommandEvent& event );
651 DECLARE_EVENT_TABLE();
653 intf_thread_t *p_intf;
656 wxComboBox *mrl_combo;
658 /* Controls for the access outputs */
659 wxPanel *access_panel;
660 wxPanel *access_subpanels[ACCESS_OUT_NUM];
661 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
665 wxComboBox *file_combo;
666 wxCheckBox *dump_checkbox;
667 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
668 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
670 /* Controls for the SAP announces */
672 wxPanel *misc_subpanels[MISC_SOUT_NUM];
673 wxCheckBox *sap_checkbox;
674 wxCheckBox *slp_checkbox;
675 wxTextCtrl *announce_group;
676 wxTextCtrl *announce_addr;
678 /* Controls for the encapsulation */
679 wxPanel *encapsulation_panel;
680 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
681 int i_encapsulation_type;
683 /* Controls for transcoding */
684 wxPanel *transcoding_panel;
685 wxCheckBox *video_transc_checkbox;
686 wxComboBox *video_codec_combo;
687 wxComboBox *audio_codec_combo;
688 wxCheckBox *audio_transc_checkbox;
689 wxComboBox *video_bitrate_combo;
690 wxComboBox *audio_bitrate_combo;
691 wxComboBox *audio_channels_combo;
692 wxComboBox *video_scale_combo;
693 wxComboBox *subtitles_codec_combo;
694 wxCheckBox *subtitles_transc_checkbox;
695 wxCheckBox *subtitles_overlay_checkbox;
698 wxCheckBox *sout_all_checkbox;
701 /* Subtitles File Dialog */
702 class SubsFileDialog: public wxDialog
706 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
707 virtual ~SubsFileDialog();
709 wxComboBox *file_combo;
710 wxComboBox *encoding_combo;
711 wxComboBox *size_combo;
712 wxComboBox *align_combo;
713 wxSpinCtrl *fps_spinctrl;
714 wxSpinCtrl *delay_spinctrl;
717 /* Event handlers (these functions should _not_ be virtual) */
718 void OnOk( wxCommandEvent& event );
719 void OnCancel( wxCommandEvent& event );
720 void OnFileBrowse( wxCommandEvent& event );
722 DECLARE_EVENT_TABLE();
724 intf_thread_t *p_intf;
729 class StreamDialog: public wxFrame
733 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
734 virtual ~StreamDialog();
737 void OnClose( wxCommandEvent& event );
738 void OnOpen( wxCommandEvent& event );
739 void OnSout( wxCommandEvent& event );
740 void OnStart( wxCommandEvent& event );
742 DECLARE_EVENT_TABLE();
744 intf_thread_t *p_intf;
746 wxStaticText *step2_label;
747 wxStaticText *step3_label;
748 wxButton *sout_button;
749 wxButton *start_button;
751 wxArrayString sout_mrl;
752 OpenDialog *p_open_dialog;
753 SoutDialog *p_sout_dialog;
757 class WizardDialog : public wxWizard
761 WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent,char *, int, int );
762 virtual ~WizardDialog();
763 void SetTranscode( char *vcodec, int vb, char *acodec,int ab);
764 void SetMrl( const char *mrl );
765 void SetTTL( int i_ttl );
766 void SetPartial( int, int );
767 void SetStream( char *method, char *address );
768 void SetTranscodeOut( const char *address );
769 void SetAction( int i_action );
771 void SetSAP( bool b_enabled, const char *psz_name );
772 void SetMux( char *mux );
779 int i_from, i_to, i_ttl;
780 char *vcodec , *acodec , *address , *mrl , *mux ;
783 DECLARE_EVENT_TABLE();
785 intf_thread_t *p_intf;
789 /* Preferences Dialog */
790 class PrefsDialog: public wxFrame
794 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
795 virtual ~PrefsDialog();
798 wxPanel *PrefsPanel( wxWindow* parent );
800 /* Event handlers (these functions should _not_ be virtual) */
801 void OnOk( wxCommandEvent& event );
802 void OnCancel( wxCommandEvent& event );
803 void OnSave( wxCommandEvent& event );
804 void OnResetAll( wxCommandEvent& event );
805 void OnAdvanced( wxCommandEvent& event );
806 void OnClose( wxCloseEvent& event );
808 DECLARE_EVENT_TABLE();
810 intf_thread_t *p_intf;
812 PrefsTreeCtrl *prefs_tree;
816 class Messages: public wxFrame
820 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
822 bool Show( bool show = TRUE );
826 /* Event handlers (these functions should _not_ be virtual) */
827 void OnButtonClose( wxCommandEvent& event );
828 void OnClose( wxCloseEvent& WXUNUSED(event) );
829 void OnClear( wxCommandEvent& event );
830 void OnSaveLog( wxCommandEvent& event );
832 DECLARE_EVENT_TABLE();
834 intf_thread_t *p_intf;
835 wxTextCtrl *textctrl;
836 wxTextAttr *info_attr;
837 wxTextAttr *err_attr;
838 wxTextAttr *warn_attr;
839 wxTextAttr *dbg_attr;
841 wxFileDialog *save_log_dialog;
843 vlc_bool_t b_verbose;
847 class Playlist: public wxFrame
851 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
854 void UpdatePlaylist();
855 void ShowPlaylist( bool show );
856 void UpdateItem( int );
857 void AppendItem( wxCommandEvent& );
862 void RemoveItem( int );
863 void DeleteTreeItem( wxTreeItemId );
864 void DeleteItem( int item );
865 void DeleteNode( playlist_item_t *node );
867 void RecursiveDeleteSelection( wxTreeItemId );
869 /* Event handlers (these functions should _not_ be virtual) */
872 void OnAddFile( wxCommandEvent& event );
873 void OnAddDir( wxCommandEvent& event );
874 void OnAddMRL( wxCommandEvent& event );
875 void OnMenuClose( wxCommandEvent& event );
876 void OnClose( wxCloseEvent& WXUNUSED(event) );
878 void OnEnableSelection( wxCommandEvent& event );
879 void OnDisableSelection( wxCommandEvent& event );
880 void OnInvertSelection( wxCommandEvent& event );
881 void OnDeleteSelection( wxCommandEvent& event );
882 void OnSelectAll( wxCommandEvent& event );
884 void OnOpen( wxCommandEvent& event );
885 void OnSave( wxCommandEvent& event );
888 void OnSearch( wxCommandEvent& event );
889 void OnSearchTextChange( wxCommandEvent& event );
890 wxTextCtrl *search_text;
891 wxButton *search_button;
892 wxTreeItemId search_current;
894 void OnEnDis( wxCommandEvent& event );
898 void OnSort( wxCommandEvent& event );
901 int i_duration_sorted;
904 void OnMenuEvent( wxCommandEvent& event );
905 void OnMenuOpen( wxMenuEvent& event );
911 void OnUp( wxCommandEvent& event);
912 void OnDown( wxCommandEvent& event);
914 void OnRandom( wxCommandEvent& event );
915 void OnRepeat( wxCommandEvent& event );
916 void OnLoop ( wxCommandEvent& event );
918 void OnActivateItem( wxTreeEvent& event );
919 void OnKeyDown( wxTreeEvent& event );
920 void OnNewGroup( wxCommandEvent& event );
925 wxTreeItemId i_wx_popup_item;
928 void OnPopup( wxContextMenuEvent& event );
929 void OnPopupPlay( wxCommandEvent& event );
930 void OnPopupPreparse( wxCommandEvent& event );
931 void OnPopupSort( wxCommandEvent& event );
932 void OnPopupDel( wxCommandEvent& event );
933 void OnPopupEna( wxCommandEvent& event );
934 void OnPopupInfo( wxCommandEvent& event );
935 void Rebuild( vlc_bool_t );
940 void UpdateNode( playlist_item_t*, wxTreeItemId );
941 void UpdateNodeChildren( playlist_item_t*, wxTreeItemId );
942 void CreateNode( playlist_item_t*, wxTreeItemId );
943 void UpdateTreeItem( wxTreeItemId );
945 /* Search (internal) */
946 int CountItems( wxTreeItemId);
947 wxTreeItemId FindItem( wxTreeItemId, int );
948 wxTreeItemId FindItemByName( wxTreeItemId, wxString,
949 wxTreeItemId, vlc_bool_t *);
951 wxTreeItemId saved_tree_item;
954 playlist_t *p_playlist;
958 void OnPlaylistEvent( wxCommandEvent& event );
960 DECLARE_EVENT_TABLE();
964 wxStatusBar *statusbar;
965 ItemInfoDialog *iteminfo_dialog;
967 int i_update_counter;
969 intf_thread_t *p_intf;
970 wxTreeCtrl *treectrl;
972 vlc_bool_t b_changed_view;
978 /* ItemInfo Dialog */
979 class ItemInfoDialog: public wxDialog
983 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
984 wxWindow *p_parent );
985 virtual ~ItemInfoDialog();
987 wxArrayString GetOptions();
990 wxPanel *InfoPanel( wxWindow* parent );
991 wxPanel *GroupPanel( wxWindow* parent );
993 /* Event handlers (these functions should _not_ be virtual) */
994 void OnOk( wxCommandEvent& event );
995 void OnCancel( wxCommandEvent& event );
999 DECLARE_EVENT_TABLE();
1001 intf_thread_t *p_intf;
1002 playlist_item_t *p_item;
1005 /* Controls for the iteminfo dialog box */
1006 wxPanel *info_subpanel;
1007 wxPanel *info_panel;
1009 wxPanel *group_subpanel;
1010 wxPanel *group_panel;
1012 wxTextCtrl *uri_text;
1013 wxTextCtrl *name_text;
1015 wxTreeCtrl *info_tree;
1016 wxTreeItemId info_root;
1022 class FileInfo: public wxFrame
1026 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
1027 virtual ~FileInfo();
1028 void UpdateFileInfo();
1030 vlc_bool_t b_need_update;
1033 void OnButtonClose( wxCommandEvent& event );
1034 void OnClose( wxCloseEvent& WXUNUSED(event) );
1036 DECLARE_EVENT_TABLE();
1038 intf_thread_t *p_intf;
1039 wxTreeCtrl *fileinfo_tree;
1040 wxTreeItemId fileinfo_root;
1041 wxString fileinfo_root_label;
1045 #if wxUSE_DRAG_AND_DROP
1046 /* Drag and Drop class */
1047 class DragAndDrop: public wxFileDropTarget
1050 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
1052 virtual bool OnDropFiles( wxCoord x, wxCoord y,
1053 const wxArrayString& filenames );
1056 intf_thread_t *p_intf;
1057 vlc_bool_t b_enqueue;
1060 } // end of wxvlc namespace
1063 class WindowSettings
1066 WindowSettings( intf_thread_t *_p_intf );
1067 virtual ~WindowSettings();
1081 void SetSettings( int id, bool _b_shown,
1082 wxPoint p = wxDefaultPosition, wxSize s = wxDefaultSize );
1083 bool GetSettings( int id, bool& _b_shown, wxPoint& p, wxSize& s );
1085 void SetScreen( int i_screen_w, int i_screen_h );
1088 intf_thread_t *p_intf;
1092 bool b_valid[ID_MAX];
1093 bool b_shown[ID_MAX];
1094 wxPoint position[ID_MAX];
1095 wxSize size[ID_MAX];
1099 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
1100 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1101 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1102 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1103 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1107 class MenuEvtHandler : public wxEvtHandler
1110 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
1111 virtual ~MenuEvtHandler();
1113 void OnMenuEvent( wxCommandEvent& event );
1114 void OnShowDialog( wxCommandEvent& event );
1118 DECLARE_EVENT_TABLE()
1120 intf_thread_t *p_intf;
1121 Interface *p_main_interface;
1124 } // end of wxvlc namespace
1128 * wxWindows keeps dead locking because the timer tries to lock the playlist
1129 * when it's already locked somewhere else in the very wxWindows interface
1130 * module. Unless someone implements a "vlc_mutex_trylock", we need that.
1132 inline void LockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1134 if( p_sys->i_playlist_usage++ == 0)
1135 vlc_mutex_lock( &p_pl->object_lock );
1138 inline void UnlockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1140 if( --p_sys->i_playlist_usage == 0)
1141 vlc_mutex_unlock( &p_pl->object_lock );
1144 using namespace wxvlc;