1 /*****************************************************************************
2 * wxwidgets.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
34 #include <wx/wxprec.h>
37 #include <wx/listctrl.h>
38 #include <wx/textctrl.h>
39 #include <wx/notebook.h>
40 #include <wx/spinctrl.h>
42 #include <wx/treectrl.h>
45 #include <wx/checkbox.h>
46 #include <wx/wizard.h>
47 #include <wx/taskbar.h>
50 #if (!wxCHECK_VERSION(2,5,0))
51 typedef long wxTreeItemIdValue;
54 DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
55 DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
57 #define SLIDER_MAX_POS 10000
59 /* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
60 #if defined( ENABLE_NLS )
62 # define wxU(utf8) wxString(utf8, wxConvUTF8)
64 # define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
68 # define wxU(ansi) wxString(ansi, wxConvLocal)
70 # define wxU(ansi) (ansi)
74 /* wxL2U (locale to unicode) is used to convert ansi strings to unicode
75 * strings (wchar_t) */
76 #define wxL2U(ansi) wxU(ansi)
93 class DialogsProvider;
99 /*****************************************************************************
100 * intf_sys_t: description and status of wxwindows interface
101 *****************************************************************************/
104 /* the wx parent window */
105 wxWindow *p_wxwindow;
108 /* window settings */
109 WindowSettings *p_window_settings;
111 /* special actions */
112 vlc_bool_t b_playing;
113 vlc_bool_t b_intf_show; /* interface to be shown */
115 /* The input thread */
116 input_thread_t * p_input;
119 int i_slider_pos; /* slider position */
120 int i_slider_oldpos; /* previous position */
121 vlc_bool_t b_slider_free; /* slider status */
123 /* The messages window */
124 msg_subscription_t* p_sub; /* message bank subscription */
126 /* Playlist management */
127 int i_playing; /* playlist selected item */
128 unsigned i_playlist_usage;
130 /* Send an event to show a dialog */
131 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
132 intf_dialog_args_t *p_arg );
135 wxMenu *p_popup_menu;
138 int i_first_hotkey_event;
142 VideoWindow *p_video_window;
143 wxBoxSizer *p_video_sizer;
144 vlc_bool_t b_video_autosize;
147 aout_instance_t *p_aout;
150 /*****************************************************************************
152 *****************************************************************************/
153 wxArrayString SeparateEntries( wxString );
154 wxWindow *CreateVideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
155 void UpdateVideoWindow( intf_thread_t *p_intf, wxWindow *p_window );
156 wxFrame *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
157 wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
164 class SubsFileDialog;
170 class ItemInfoDialog;
172 class ExportPlaylist;
174 /*****************************************************************************
175 * Classes declarations.
176 *****************************************************************************/
178 class Timer: public wxTimer
182 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
185 virtual void Notify();
188 //use wxWindow::IsShown instead
189 //vlc_bool_t b_slider_shown;
190 //vlc_bool_t b_disc_shown;
191 intf_thread_t *p_intf;
192 Interface *p_main_interface;
194 int i_old_playing_status;
200 class ExtraPanel: public wxPanel
204 ExtraPanel( intf_thread_t *p_intf, wxWindow *p_parent );
205 virtual ~ExtraPanel();
207 wxStaticBox *adjust_box;
208 wxButton *restoredefaults_button;
209 wxSlider *brightness_slider;
210 wxSlider *contrast_slider;
211 wxSlider *saturation_slider;
212 wxSlider *hue_slider;
213 wxSlider *gamma_slider;
215 wxStaticBox *other_box;
216 wxComboBox *ratio_combo;
224 wxPanel *VideoPanel( wxWindow * );
225 wxPanel *EqzPanel( wxWindow * );
226 wxPanel *AudioPanel( wxWindow * );
228 wxNotebook *notebook;
230 wxCheckBox *eq_chkbox;
232 wxCheckBox *eq_2p_chkbox;
234 wxButton *eq_restoredefaults_button;
236 wxSlider *smooth_slider;
237 wxStaticText *smooth_text;
239 wxSlider *preamp_slider;
240 wxStaticText * preamp_text;
245 wxSlider *band_sliders[10];
246 wxStaticText *band_texts[10];
252 /* Event handlers (these functions should _not_ be virtual) */
254 void OnEnableAdjust( wxCommandEvent& );
255 void OnEnableEqualizer( wxCommandEvent& );
256 void OnRestoreDefaults( wxCommandEvent& );
257 void OnChangeEqualizer( wxScrollEvent& );
258 void OnAdjustUpdate( wxScrollEvent& );
259 void OnRatio( wxCommandEvent& );
260 void OnFiltersInfo( wxCommandEvent& );
261 void OnSelectFilter( wxCommandEvent& );
263 void OnEqSmooth( wxScrollEvent& );
264 void OnPreamp( wxScrollEvent& );
265 void OnEq2Pass( wxCommandEvent& );
266 void OnEqRestore( wxCommandEvent& );
268 void OnHeadphone( wxCommandEvent& );
269 void OnNormvol( wxCommandEvent& );
270 void OnNormvolSlider( wxScrollEvent& );
272 void OnIdle( wxIdleEvent& );
274 DECLARE_EVENT_TABLE();
276 intf_thread_t *p_intf;
277 vlc_bool_t b_my_update;
281 /* Extended Window */
282 class ExtraWindow: public wxFrame
286 ExtraWindow( intf_thread_t *p_intf, wxWindow *p_parent, wxPanel *panel );
287 virtual ~ExtraWindow();
293 DECLARE_EVENT_TABLE();
295 intf_thread_t *p_intf;
299 /* Systray integration */
300 #ifdef wxHAS_TASK_BAR_ICON
301 class Systray: public wxTaskBarIcon
304 Systray( Interface* p_main_interface, intf_thread_t *p_intf );
305 virtual ~Systray() {};
306 wxMenu* CreatePopupMenu();
307 void UpdateTooltip( const wxChar* tooltip );
310 void OnMenuIconize( wxCommandEvent& event );
311 void OnLeftClick( wxTaskBarIconEvent& event );
312 void OnPlayStream ( wxCommandEvent& event );
313 void OnStopStream ( wxCommandEvent& event );
314 void OnPrevStream ( wxCommandEvent& event );
315 void OnNextStream ( wxCommandEvent& event );
316 void OnExit( wxCommandEvent& event );
317 Interface* p_main_interface;
318 intf_thread_t *p_intf;
319 DECLARE_EVENT_TABLE()
324 class Interface: public wxFrame
328 Interface( intf_thread_t *p_intf, long style = wxDEFAULT_FRAME_STYLE );
329 virtual ~Interface();
331 void TogglePlayButton( int i_playing_status );
338 wxBoxSizer *frame_sizer;
339 wxStatusBar *statusbar;
341 void HideSlider(bool layout = true);
342 void ShowSlider(bool show = true, bool layout = true);
345 wxWindow *slider_frame;
346 wxBoxSizer *slider_sizer;
347 wxPanel *extra_frame;
349 void HideDiscFrame(bool layout = true);
350 void ShowDiscFrame(bool show = true, bool layout = true);
353 wxBoxSizer *disc_sizer;
354 wxBitmapButton *disc_menu_button;
355 wxBitmapButton *disc_prev_button;
356 wxBitmapButton *disc_next_button;
358 wxFrame *extra_window;
365 #ifdef wxHAS_TASK_BAR_ICON
369 wxTimer m_controls_timer;
370 wxTimer m_slider_timer;
374 void CreateOurMenuBar();
375 void CreateOurToolBar();
376 void CreateOurExtendedPanel();
377 void CreateOurSlider();
378 void Open( int i_access_method );
380 /* Event handlers (these functions should _not_ be virtual) */
381 void OnControlsTimer(wxTimerEvent& WXUNUSED(event));
382 void OnSliderTimer(wxTimerEvent& WXUNUSED(event));
384 void OnExit( wxCommandEvent& event );
385 void OnAbout( wxCommandEvent& event );
387 void OnOpenFileSimple( wxCommandEvent& event );
388 void OnOpenDir( wxCommandEvent& event );
389 void OnOpenFile( wxCommandEvent& event );
390 void OnOpenDisc( wxCommandEvent& event );
391 void OnOpenNet( wxCommandEvent& event );
392 void OnOpenSat( wxCommandEvent& event );
394 void OnExtended( wxCommandEvent& event );
395 //void OnUndock( wxCommandEvent& event );
397 void OnBookmarks( wxCommandEvent& event );
398 void OnShowDialog( wxCommandEvent& event );
399 void OnPlayStream( wxCommandEvent& event );
400 void OnStopStream( wxCommandEvent& event );
401 void OnSliderUpdate( wxScrollEvent& event );
402 void OnPrevStream( wxCommandEvent& event );
403 void OnNextStream( wxCommandEvent& event );
404 void OnSlowStream( wxCommandEvent& event );
405 void OnFastStream( wxCommandEvent& event );
407 void OnDiscMenu( wxCommandEvent& event );
408 void OnDiscPrev( wxCommandEvent& event );
409 void OnDiscNext( wxCommandEvent& event );
411 void OnMenuOpen( wxMenuEvent& event );
413 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
414 void OnContextMenu2(wxContextMenuEvent& event);
416 void OnContextMenu(wxMouseEvent& event);
418 void OnControlEvent( wxCommandEvent& event );
420 DECLARE_EVENT_TABLE();
423 intf_thread_t *p_intf;
425 wxWindow *video_window;
427 int i_old_playing_status;
429 /* For auto-generated menus */
430 wxMenu *p_settings_menu;
431 wxMenu *p_audio_menu;
432 wxMenu *p_video_menu;
433 wxMenu *p_navig_menu;
437 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
438 class OpenDialog: public wxDialog
442 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
443 int i_access_method, int i_arg = 0 );
445 /* Extended Contructor */
446 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
447 int i_access_method, int i_arg = 0 , int _i_method = 0 );
448 virtual ~OpenDialog();
451 int Show( int i_access_method, int i_arg = 0 );
454 void UpdateMRL( int i_access_method );
459 wxPanel *FilePanel( wxWindow* parent );
460 wxPanel *DiscPanel( wxWindow* parent );
461 wxPanel *NetPanel( wxWindow* parent );
463 ArrayOfAutoBuiltPanel input_tab_array;
465 /* Event handlers (these functions should _not_ be virtual) */
466 void OnOk( wxCommandEvent& event );
467 void OnCancel( wxCommandEvent& event );
468 void OnClose( wxCloseEvent& event );
470 void OnPageChange( wxNotebookEvent& event );
471 void OnMRLChange( wxCommandEvent& event );
473 /* Event handlers for the file page */
474 void OnFilePanelChange( wxCommandEvent& event );
475 void OnFileBrowse( wxCommandEvent& event );
477 /* Event handlers for the disc page */
478 void OnDiscPanelChangeSpin( wxSpinEvent& event );
479 void OnDiscPanelChange( wxCommandEvent& event );
480 void OnDiscTypeChange( wxCommandEvent& event );
482 void OnDiscProbe( wxCommandEvent& event );
484 void OnDiscDeviceChange( wxCommandEvent& event );
486 /* Event handlers for the net page */
487 void OnNetPanelChangeSpin( wxSpinEvent& event );
488 void OnNetPanelChange( wxCommandEvent& event );
489 void OnNetTypeChange( wxCommandEvent& event );
491 /* Event handlers for the stream output */
492 void OnSubsFileEnable( wxCommandEvent& event );
493 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
495 /* Event handlers for the stream output */
496 void OnSoutEnable( wxCommandEvent& event );
497 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
499 /* Event handlers for the caching option */
500 void OnCachingEnable( wxCommandEvent& event );
501 void OnCachingChange( wxCommandEvent& event );
502 void OnCachingChangeSpin( wxSpinEvent& event );
504 DECLARE_EVENT_TABLE();
506 intf_thread_t *p_intf;
508 int i_current_access_method;
509 int i_disc_type_selection;
511 int i_method; /* Normal or for the stream dialog ? */
514 wxComboBox *mrl_combo;
515 wxNotebook *notebook;
517 /* Controls for the file panel */
518 wxComboBox *file_combo;
519 wxFileDialog *file_dialog;
521 /* Controls for the disc panel */
522 wxRadioBox *disc_type;
523 wxCheckBox *disc_probe;
524 wxTextCtrl *disc_device;
525 wxSpinCtrl *disc_title; int i_disc_title;
526 wxSpinCtrl *disc_chapter; int i_disc_chapter;
527 wxSpinCtrl *disc_sub; int i_disc_sub;
528 wxSpinCtrl *disc_audio; int i_disc_audio;
530 /* The media equivalent name for a DVD names. For example,
531 * "Title", is "Track" for a CD-DA */
532 wxStaticText *disc_title_label;
533 wxStaticText *disc_chapter_label;
534 wxStaticText *disc_sub_label;
535 wxStaticText *disc_audio_label;
537 /* Indicates if the disc device control was modified */
538 bool b_disc_device_changed;
540 /* Controls for the net panel */
541 wxRadioBox *net_type;
543 wxPanel *net_subpanels[4];
544 wxRadioButton *net_radios[4];
545 wxSpinCtrl *net_ports[4];
547 wxTextCtrl *net_addrs[4];
548 wxCheckBox *net_timeshift;
549 wxCheckBox *net_ipv6;
551 /* Controls for the subtitles file */
552 wxButton *subsfile_button;
553 wxCheckBox *subsfile_checkbox;
554 SubsFileDialog *subsfile_dialog;
555 wxArrayString subsfile_mrl;
557 /* Controls for the stream output */
558 wxButton *sout_button;
559 wxCheckBox *sout_checkbox;
560 SoutDialog *sout_dialog;
561 wxArrayString sout_mrl;
563 /* Controls for the caching options */
564 wxCheckBox *caching_checkbox;
565 wxSpinCtrl *caching_value;
575 /* Auto-built panels */
578 #define MAX_ACCESS CAPTURE_ACCESS
580 /* Stream output Dialog */
593 TS_ENCAPSULATION = 0,
613 class SoutDialog: public wxDialog
617 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
618 virtual ~SoutDialog();
620 wxArrayString GetOptions();
624 wxPanel *AccessPanel( wxWindow* parent );
625 wxPanel *MiscPanel( wxWindow* parent );
626 wxPanel *EncapsulationPanel( wxWindow* parent );
627 wxPanel *TranscodingPanel( wxWindow* parent );
630 /* Event handlers (these functions should _not_ be virtual) */
631 void OnOk( wxCommandEvent& event );
632 void OnCancel( wxCommandEvent& event );
633 void OnMRLChange( wxCommandEvent& event );
634 void OnAccessTypeChange( wxCommandEvent& event );
636 /* Event handlers for the file access output */
637 void OnFileChange( wxCommandEvent& event );
638 void OnFileBrowse( wxCommandEvent& event );
639 void OnFileDump( wxCommandEvent& event );
641 /* Event handlers for the net access output */
642 void OnNetChange( wxCommandEvent& event );
644 /* Event specific to the announce address */
645 void OnAnnounceGroupChange( wxCommandEvent& event );
646 void OnAnnounceAddrChange( wxCommandEvent& event );
648 /* Event handlers for the encapsulation panel */
649 void OnEncapsulationChange( wxCommandEvent& event );
651 /* Event handlers for the transcoding panel */
652 void OnTranscodingEnable( wxCommandEvent& event );
653 void OnTranscodingChange( wxCommandEvent& event );
655 /* Event handlers for the misc panel */
656 void OnSAPMiscChange( wxCommandEvent& event );
658 DECLARE_EVENT_TABLE();
660 intf_thread_t *p_intf;
663 wxComboBox *mrl_combo;
665 /* Controls for the access outputs */
666 wxPanel *access_panel;
667 wxPanel *access_subpanels[ACCESS_OUT_NUM];
668 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
672 wxComboBox *file_combo;
673 wxCheckBox *dump_checkbox;
674 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
675 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
677 /* Controls for the SAP announces and TTL setting */
679 wxPanel *misc_subpanels[MISC_SOUT_NUM];
680 wxCheckBox *sap_checkbox;
681 wxTextCtrl *announce_group;
682 wxTextCtrl *announce_addr;
683 wxSpinCtrl *ttl_spin;
685 /* Controls for the encapsulation */
686 wxPanel *encapsulation_panel;
687 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
688 int i_encapsulation_type;
690 /* Controls for transcoding */
691 wxPanel *transcoding_panel;
692 wxCheckBox *video_transc_checkbox;
693 wxComboBox *video_codec_combo;
694 wxComboBox *audio_codec_combo;
695 wxCheckBox *audio_transc_checkbox;
696 wxComboBox *video_bitrate_combo;
697 wxComboBox *audio_bitrate_combo;
698 wxComboBox *audio_channels_combo;
699 wxComboBox *video_scale_combo;
700 wxComboBox *subtitles_codec_combo;
701 wxCheckBox *subtitles_transc_checkbox;
702 wxCheckBox *subtitles_overlay_checkbox;
705 wxCheckBox *sout_all_checkbox;
708 /* Subtitles File Dialog */
709 class SubsFileDialog: public wxDialog
713 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
714 virtual ~SubsFileDialog();
716 wxComboBox *file_combo;
717 wxComboBox *encoding_combo;
718 wxComboBox *size_combo;
719 wxComboBox *align_combo;
720 wxSpinCtrl *fps_spinctrl;
721 wxSpinCtrl *delay_spinctrl;
724 /* Event handlers (these functions should _not_ be virtual) */
725 void OnOk( wxCommandEvent& event );
726 void OnCancel( wxCommandEvent& event );
727 void OnFileBrowse( wxCommandEvent& event );
729 DECLARE_EVENT_TABLE();
731 intf_thread_t *p_intf;
736 class StreamDialog: public wxFrame
740 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
741 virtual ~StreamDialog();
744 void OnClose( wxCommandEvent& event );
745 void OnOpen( wxCommandEvent& event );
746 void OnSout( wxCommandEvent& event );
747 void OnStart( wxCommandEvent& event );
749 DECLARE_EVENT_TABLE();
751 intf_thread_t *p_intf;
753 wxStaticText *step2_label;
754 wxStaticText *step3_label;
755 wxButton *sout_button;
756 wxButton *start_button;
758 wxArrayString sout_mrl;
759 OpenDialog *p_open_dialog;
760 SoutDialog *p_sout_dialog;
764 class WizardDialog : public wxWizard
768 WizardDialog( intf_thread_t *, wxWindow *p_parent, char *, int, int );
769 virtual ~WizardDialog();
770 void SetTranscode( char const *vcodec, int vb, char const *acodec, int ab);
771 void SetMrl( const char *mrl );
772 void SetTTL( int i_ttl );
773 void SetPartial( int, int );
774 void SetStream( char const *method, char const *address );
775 void SetTranscodeOut( char const *address );
776 void SetAction( int i_action );
778 void SetSAP( bool b_enabled, const char *psz_name );
779 void SetMux( char const *mux );
786 int i_from, i_to, i_ttl;
787 char *vcodec , *acodec , *address , *mrl , *mux ;
790 DECLARE_EVENT_TABLE();
792 intf_thread_t *p_intf;
796 /* Preferences Dialog */
797 class PrefsDialog: public wxFrame
801 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
802 virtual ~PrefsDialog();
805 wxPanel *PrefsPanel( wxWindow* parent );
807 /* Event handlers (these functions should _not_ be virtual) */
808 void OnOk( wxCommandEvent& event );
809 void OnCancel( wxCommandEvent& event );
810 void OnSave( wxCommandEvent& event );
811 void OnResetAll( wxCommandEvent& event );
812 void OnAdvanced( wxCommandEvent& event );
813 void OnClose( wxCloseEvent& event );
815 DECLARE_EVENT_TABLE();
817 intf_thread_t *p_intf;
819 PrefsTreeCtrl *prefs_tree;
823 class Messages: public wxFrame
827 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
829 bool Show( bool show = TRUE );
833 /* Event handlers (these functions should _not_ be virtual) */
834 void OnButtonClose( wxCommandEvent& event );
835 void OnClose( wxCloseEvent& WXUNUSED(event) );
836 void OnClear( wxCommandEvent& event );
837 void OnSaveLog( wxCommandEvent& event );
839 DECLARE_EVENT_TABLE();
841 intf_thread_t *p_intf;
842 wxTextCtrl *textctrl;
843 wxTextAttr *info_attr;
844 wxTextAttr *err_attr;
845 wxTextAttr *warn_attr;
846 wxTextAttr *dbg_attr;
848 wxFileDialog *save_log_dialog;
850 vlc_bool_t b_verbose;
854 class Playlist: public wxFrame
858 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
861 void UpdatePlaylist();
862 void ShowPlaylist( bool show );
863 void UpdateItem( int );
864 void AppendItem( wxCommandEvent& );
869 void RemoveItem( int );
870 void DeleteTreeItem( wxTreeItemId );
871 void DeleteItem( int item );
872 void DeleteNode( playlist_item_t *node );
874 void RecursiveDeleteSelection( wxTreeItemId );
876 /* Event handlers (these functions should _not_ be virtual) */
879 void OnAddFile( wxCommandEvent& event );
880 void OnAddDir( wxCommandEvent& event );
881 void OnAddMRL( wxCommandEvent& event );
882 void OnMenuClose( wxCommandEvent& event );
883 void OnClose( wxCloseEvent& WXUNUSED(event) );
885 void OnDeleteSelection( wxCommandEvent& event );
887 void OnOpen( wxCommandEvent& event );
888 void OnSave( wxCommandEvent& event );
891 void OnSearch( wxCommandEvent& event );
892 /*void OnSearchTextChange( wxCommandEvent& event );*/
893 wxTextCtrl *search_text;
894 wxButton *search_button;
895 wxTreeItemId search_current;
897 void OnEnDis( wxCommandEvent& event );
901 void OnSort( wxCommandEvent& event );
904 int i_duration_sorted;
907 void OnMenuEvent( wxCommandEvent& event );
908 void OnMenuOpen( wxMenuEvent& event );
914 void OnUp( wxCommandEvent& event);
915 void OnDown( wxCommandEvent& event);
917 void OnRandom( wxCommandEvent& event );
918 void OnRepeat( wxCommandEvent& event );
919 void OnLoop ( wxCommandEvent& event );
921 void OnActivateItem( wxTreeEvent& event );
922 void OnKeyDown( wxTreeEvent& event );
923 void OnNewGroup( wxCommandEvent& event );
928 wxTreeItemId i_wx_popup_item;
931 void OnPopup( wxContextMenuEvent& event );
932 void OnPopupPlay( wxCommandEvent& event );
933 void OnPopupPreparse( wxCommandEvent& event );
934 void OnPopupSort( wxCommandEvent& event );
935 void OnPopupDel( wxCommandEvent& event );
936 void OnPopupEna( wxCommandEvent& event );
937 void OnPopupInfo( wxCommandEvent& event );
938 void Rebuild( vlc_bool_t );
943 void UpdateNode( playlist_item_t*, wxTreeItemId );
944 void UpdateNodeChildren( playlist_item_t*, wxTreeItemId );
945 void CreateNode( playlist_item_t*, wxTreeItemId );
946 void UpdateTreeItem( wxTreeItemId );
948 /* Search (internal) */
949 int CountItems( wxTreeItemId);
950 wxTreeItemId FindItem( wxTreeItemId, int );
951 wxTreeItemId FindItemByName( wxTreeItemId, wxString,
952 wxTreeItemId, vlc_bool_t *);
954 wxTreeItemId saved_tree_item;
957 playlist_t *p_playlist;
961 void OnPlaylistEvent( wxCommandEvent& event );
963 DECLARE_EVENT_TABLE();
967 wxStatusBar *statusbar;
968 ItemInfoDialog *iteminfo_dialog;
970 int i_update_counter;
972 intf_thread_t *p_intf;
973 wxTreeCtrl *treectrl;
975 vlc_bool_t b_changed_view;
981 /* ItemInfo Dialog */
982 class ItemInfoDialog: public wxDialog
986 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
987 wxWindow *p_parent );
988 virtual ~ItemInfoDialog();
990 wxArrayString GetOptions();
993 wxPanel *InfoPanel( wxWindow* parent );
994 wxPanel *GroupPanel( wxWindow* parent );
996 /* Event handlers (these functions should _not_ be virtual) */
997 void OnOk( wxCommandEvent& event );
998 void OnCancel( wxCommandEvent& event );
1002 DECLARE_EVENT_TABLE();
1004 intf_thread_t *p_intf;
1005 playlist_item_t *p_item;
1008 /* Controls for the iteminfo dialog box */
1009 wxPanel *info_subpanel;
1010 wxPanel *info_panel;
1012 wxPanel *group_subpanel;
1013 wxPanel *group_panel;
1015 wxTextCtrl *uri_text;
1016 wxTextCtrl *name_text;
1018 wxTreeCtrl *info_tree;
1019 wxTreeItemId info_root;
1025 class FileInfo: public wxFrame
1029 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
1030 virtual ~FileInfo();
1031 void UpdateFileInfo();
1033 vlc_bool_t b_need_update;
1036 void OnButtonClose( wxCommandEvent& event );
1037 void OnClose( wxCloseEvent& WXUNUSED(event) );
1039 DECLARE_EVENT_TABLE();
1041 intf_thread_t *p_intf;
1042 wxTreeCtrl *fileinfo_tree;
1043 wxTreeItemId fileinfo_root;
1044 wxString fileinfo_root_label;
1049 class UpdateVLC: public wxFrame
1053 UpdateVLC( intf_thread_t *p_intf, wxWindow *p_parent );
1054 virtual ~UpdateVLC();
1057 void OnButtonClose( wxCommandEvent& event );
1058 void OnClose( wxCloseEvent& WXUNUSED(event) );
1060 void OnCheckForUpdate( wxCommandEvent& event );
1061 void OnMirrorChoice( wxCommandEvent& event );
1062 void UpdateUpdatesTree();
1063 void UpdateMirrorsChoice();
1064 void OnUpdatesTreeActivate( wxTreeEvent& event );
1065 void DownloadFile( wxString url, wxString dst );
1067 DECLARE_EVENT_TABLE();
1069 intf_thread_t *p_intf;
1070 wxTreeCtrl *updates_tree;
1071 wxTreeItemId updates_root;
1073 wxChoice *mirrors_choice;
1075 wxString release_type; /* could be "stable", "test", "nightly" ... */
1077 struct update_file_t
1083 wxString description;
1086 struct update_version_t
1093 std::list<update_file_t> m_files;
1096 std::list<update_version_t> m_versions;
1098 struct update_mirror_t
1106 std::list<update_mirror_t> m_mirrors;
1109 #if wxUSE_DRAG_AND_DROP
1110 /* Drag and Drop class */
1111 class DragAndDrop: public wxFileDropTarget
1114 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
1116 virtual bool OnDropFiles( wxCoord x, wxCoord y,
1117 const wxArrayString& filenames );
1120 intf_thread_t *p_intf;
1121 vlc_bool_t b_enqueue;
1124 } // end of wxvlc namespace
1127 class WindowSettings
1130 WindowSettings( intf_thread_t *_p_intf );
1131 virtual ~WindowSettings();
1145 void SetSettings( int id, bool _b_shown,
1146 wxPoint p = wxDefaultPosition, wxSize s = wxDefaultSize );
1147 bool GetSettings( int id, bool& _b_shown, wxPoint& p, wxSize& s );
1149 void SetScreen( int i_screen_w, int i_screen_h );
1152 intf_thread_t *p_intf;
1156 bool b_valid[ID_MAX];
1157 bool b_shown[ID_MAX];
1158 wxPoint position[ID_MAX];
1159 wxSize size[ID_MAX];
1163 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
1164 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1165 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1166 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1167 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1171 class MenuEvtHandler : public wxEvtHandler
1174 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
1175 virtual ~MenuEvtHandler();
1177 void OnMenuEvent( wxCommandEvent& event );
1178 void OnShowDialog( wxCommandEvent& event );
1182 DECLARE_EVENT_TABLE()
1184 intf_thread_t *p_intf;
1185 Interface *p_main_interface;
1188 } // end of wxvlc namespace
1192 * wxWindows keeps dead locking because the timer tries to lock the playlist
1193 * when it's already locked somewhere else in the very wxWindows interface
1194 * module. Unless someone implements a "vlc_mutex_trylock", we need that.
1196 inline void LockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1198 if( p_sys->i_playlist_usage++ == 0)
1199 vlc_mutex_lock( &p_pl->object_lock );
1202 inline void UnlockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1204 if( --p_sys->i_playlist_usage == 0)
1205 vlc_mutex_unlock( &p_pl->object_lock );
1208 using namespace wxvlc;