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 );
484 void OnDiscProbe( wxCommandEvent& event );
486 void OnDiscDeviceChange( wxCommandEvent& event );
488 /* Event handlers for the net page */
489 void OnNetPanelChangeSpin( wxSpinEvent& event );
490 void OnNetPanelChange( wxCommandEvent& event );
491 void OnNetTypeChange( wxCommandEvent& event );
493 /* Event handlers for the stream output */
494 void OnSubsFileEnable( wxCommandEvent& event );
495 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
497 /* Event handlers for the stream output */
498 void OnSoutEnable( wxCommandEvent& event );
499 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
501 /* Event handlers for the caching option */
502 void OnCachingEnable( wxCommandEvent& event );
503 void OnCachingChange( wxCommandEvent& event );
504 void OnCachingChangeSpin( wxSpinEvent& event );
506 DECLARE_EVENT_TABLE();
508 intf_thread_t *p_intf;
510 int i_current_access_method;
511 int i_disc_type_selection;
513 int i_method; /* Normal or for the stream dialog ? */
516 wxComboBox *mrl_combo;
517 wxNotebook *notebook;
519 /* Controls for the file panel */
520 wxComboBox *file_combo;
521 wxFileDialog *file_dialog;
523 /* Controls for the disc panel */
524 wxRadioBox *disc_type;
525 wxCheckBox *disc_probe;
526 wxTextCtrl *disc_device;
527 wxSpinCtrl *disc_title; int i_disc_title;
528 wxSpinCtrl *disc_chapter; int i_disc_chapter;
529 wxSpinCtrl *disc_sub; int i_disc_sub;
530 wxSpinCtrl *disc_audio; int i_disc_audio;
532 /* The media equivalent name for a DVD names. For example,
533 * "Title", is "Track" for a CD-DA */
534 wxStaticText *disc_title_label;
535 wxStaticText *disc_chapter_label;
536 wxStaticText *disc_sub_label;
537 wxStaticText *disc_audio_label;
539 /* Indicates if the disc device control was modified */
540 bool b_disc_device_changed;
542 /* Controls for the net panel */
543 wxRadioBox *net_type;
545 wxPanel *net_subpanels[4];
546 wxRadioButton *net_radios[4];
547 wxSpinCtrl *net_ports[4];
549 wxTextCtrl *net_addrs[4];
550 wxCheckBox *net_timeshift;
551 wxCheckBox *net_ipv6;
553 /* Controls for the subtitles file */
554 wxButton *subsfile_button;
555 wxCheckBox *subsfile_checkbox;
556 SubsFileDialog *subsfile_dialog;
557 wxArrayString subsfile_mrl;
559 /* Controls for the stream output */
560 wxButton *sout_button;
561 wxCheckBox *sout_checkbox;
562 SoutDialog *sout_dialog;
563 wxArrayString sout_mrl;
565 /* Controls for the caching options */
566 wxCheckBox *caching_checkbox;
567 wxSpinCtrl *caching_value;
577 /* Auto-built panels */
580 #define MAX_ACCESS CAPTURE_ACCESS
582 /* Stream output Dialog */
595 TS_ENCAPSULATION = 0,
614 class SoutDialog: public wxDialog
618 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
619 virtual ~SoutDialog();
621 wxArrayString GetOptions();
625 wxPanel *AccessPanel( wxWindow* parent );
626 wxPanel *MiscPanel( wxWindow* parent );
627 wxPanel *EncapsulationPanel( wxWindow* parent );
628 wxPanel *TranscodingPanel( wxWindow* parent );
631 /* Event handlers (these functions should _not_ be virtual) */
632 void OnOk( wxCommandEvent& event );
633 void OnCancel( wxCommandEvent& event );
634 void OnMRLChange( wxCommandEvent& event );
635 void OnAccessTypeChange( wxCommandEvent& event );
637 /* Event handlers for the file access output */
638 void OnFileChange( wxCommandEvent& event );
639 void OnFileBrowse( wxCommandEvent& event );
640 void OnFileDump( wxCommandEvent& event );
642 /* Event handlers for the net access output */
643 void OnNetChange( wxCommandEvent& event );
645 /* Event specific to the announce address */
646 void OnAnnounceGroupChange( wxCommandEvent& event );
647 void OnAnnounceAddrChange( wxCommandEvent& event );
649 /* Event handlers for the encapsulation panel */
650 void OnEncapsulationChange( wxCommandEvent& event );
652 /* Event handlers for the transcoding panel */
653 void OnTranscodingEnable( wxCommandEvent& event );
654 void OnTranscodingChange( wxCommandEvent& event );
656 /* Event handlers for the misc panel */
657 void OnSAPMiscChange( wxCommandEvent& event );
658 void OnSLPMiscChange( wxCommandEvent& event );
660 DECLARE_EVENT_TABLE();
662 intf_thread_t *p_intf;
665 wxComboBox *mrl_combo;
667 /* Controls for the access outputs */
668 wxPanel *access_panel;
669 wxPanel *access_subpanels[ACCESS_OUT_NUM];
670 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
674 wxComboBox *file_combo;
675 wxCheckBox *dump_checkbox;
676 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
677 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
679 /* Controls for the SAP announces */
681 wxPanel *misc_subpanels[MISC_SOUT_NUM];
682 wxCheckBox *sap_checkbox;
683 wxCheckBox *slp_checkbox;
684 wxTextCtrl *announce_group;
685 wxTextCtrl *announce_addr;
687 /* Controls for the encapsulation */
688 wxPanel *encapsulation_panel;
689 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
690 int i_encapsulation_type;
692 /* Controls for transcoding */
693 wxPanel *transcoding_panel;
694 wxCheckBox *video_transc_checkbox;
695 wxComboBox *video_codec_combo;
696 wxComboBox *audio_codec_combo;
697 wxCheckBox *audio_transc_checkbox;
698 wxComboBox *video_bitrate_combo;
699 wxComboBox *audio_bitrate_combo;
700 wxComboBox *audio_channels_combo;
701 wxComboBox *video_scale_combo;
702 wxComboBox *subtitles_codec_combo;
703 wxCheckBox *subtitles_transc_checkbox;
704 wxCheckBox *subtitles_overlay_checkbox;
707 wxCheckBox *sout_all_checkbox;
710 /* Subtitles File Dialog */
711 class SubsFileDialog: public wxDialog
715 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
716 virtual ~SubsFileDialog();
718 wxComboBox *file_combo;
719 wxComboBox *encoding_combo;
720 wxComboBox *size_combo;
721 wxComboBox *align_combo;
722 wxSpinCtrl *fps_spinctrl;
723 wxSpinCtrl *delay_spinctrl;
726 /* Event handlers (these functions should _not_ be virtual) */
727 void OnOk( wxCommandEvent& event );
728 void OnCancel( wxCommandEvent& event );
729 void OnFileBrowse( wxCommandEvent& event );
731 DECLARE_EVENT_TABLE();
733 intf_thread_t *p_intf;
738 class StreamDialog: public wxFrame
742 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
743 virtual ~StreamDialog();
746 void OnClose( wxCommandEvent& event );
747 void OnOpen( wxCommandEvent& event );
748 void OnSout( wxCommandEvent& event );
749 void OnStart( wxCommandEvent& event );
751 DECLARE_EVENT_TABLE();
753 intf_thread_t *p_intf;
755 wxStaticText *step2_label;
756 wxStaticText *step3_label;
757 wxButton *sout_button;
758 wxButton *start_button;
760 wxArrayString sout_mrl;
761 OpenDialog *p_open_dialog;
762 SoutDialog *p_sout_dialog;
766 class WizardDialog : public wxWizard
770 WizardDialog( intf_thread_t *, wxWindow *p_parent, char *, int, int );
771 virtual ~WizardDialog();
772 void SetTranscode( char const *vcodec, int vb, char const *acodec, int ab);
773 void SetMrl( const char *mrl );
774 void SetTTL( int i_ttl );
775 void SetPartial( int, int );
776 void SetStream( char const *method, char const *address );
777 void SetTranscodeOut( char const *address );
778 void SetAction( int i_action );
780 void SetSAP( bool b_enabled, const char *psz_name );
781 void SetMux( char const *mux );
788 int i_from, i_to, i_ttl;
789 char *vcodec , *acodec , *address , *mrl , *mux ;
792 DECLARE_EVENT_TABLE();
794 intf_thread_t *p_intf;
798 /* Preferences Dialog */
799 class PrefsDialog: public wxFrame
803 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
804 virtual ~PrefsDialog();
807 wxPanel *PrefsPanel( wxWindow* parent );
809 /* Event handlers (these functions should _not_ be virtual) */
810 void OnOk( wxCommandEvent& event );
811 void OnCancel( wxCommandEvent& event );
812 void OnSave( wxCommandEvent& event );
813 void OnResetAll( wxCommandEvent& event );
814 void OnAdvanced( wxCommandEvent& event );
815 void OnClose( wxCloseEvent& event );
817 DECLARE_EVENT_TABLE();
819 intf_thread_t *p_intf;
821 PrefsTreeCtrl *prefs_tree;
825 class Messages: public wxFrame
829 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
831 bool Show( bool show = TRUE );
835 /* Event handlers (these functions should _not_ be virtual) */
836 void OnButtonClose( wxCommandEvent& event );
837 void OnClose( wxCloseEvent& WXUNUSED(event) );
838 void OnClear( wxCommandEvent& event );
839 void OnSaveLog( wxCommandEvent& event );
841 DECLARE_EVENT_TABLE();
843 intf_thread_t *p_intf;
844 wxTextCtrl *textctrl;
845 wxTextAttr *info_attr;
846 wxTextAttr *err_attr;
847 wxTextAttr *warn_attr;
848 wxTextAttr *dbg_attr;
850 wxFileDialog *save_log_dialog;
852 vlc_bool_t b_verbose;
856 class Playlist: public wxFrame
860 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
863 void UpdatePlaylist();
864 void ShowPlaylist( bool show );
865 void UpdateItem( int );
866 void AppendItem( wxCommandEvent& );
871 void RemoveItem( int );
872 void DeleteTreeItem( wxTreeItemId );
873 void DeleteItem( int item );
874 void DeleteNode( playlist_item_t *node );
876 void RecursiveDeleteSelection( wxTreeItemId );
878 /* Event handlers (these functions should _not_ be virtual) */
881 void OnAddFile( wxCommandEvent& event );
882 void OnAddDir( wxCommandEvent& event );
883 void OnAddMRL( wxCommandEvent& event );
884 void OnMenuClose( wxCommandEvent& event );
885 void OnClose( wxCloseEvent& WXUNUSED(event) );
887 void OnDeleteSelection( wxCommandEvent& event );
889 void OnOpen( wxCommandEvent& event );
890 void OnSave( wxCommandEvent& event );
893 void OnSearch( wxCommandEvent& event );
894 /*void OnSearchTextChange( wxCommandEvent& event );*/
895 wxTextCtrl *search_text;
896 wxButton *search_button;
897 wxTreeItemId search_current;
899 void OnEnDis( wxCommandEvent& event );
903 void OnSort( wxCommandEvent& event );
906 int i_duration_sorted;
909 void OnMenuEvent( wxCommandEvent& event );
910 void OnMenuOpen( wxMenuEvent& event );
916 void OnUp( wxCommandEvent& event);
917 void OnDown( wxCommandEvent& event);
919 void OnRandom( wxCommandEvent& event );
920 void OnRepeat( wxCommandEvent& event );
921 void OnLoop ( wxCommandEvent& event );
923 void OnActivateItem( wxTreeEvent& event );
924 void OnKeyDown( wxTreeEvent& event );
925 void OnNewGroup( wxCommandEvent& event );
930 wxTreeItemId i_wx_popup_item;
933 void OnPopup( wxContextMenuEvent& event );
934 void OnPopupPlay( wxCommandEvent& event );
935 void OnPopupPreparse( wxCommandEvent& event );
936 void OnPopupSort( wxCommandEvent& event );
937 void OnPopupDel( wxCommandEvent& event );
938 void OnPopupEna( wxCommandEvent& event );
939 void OnPopupInfo( wxCommandEvent& event );
940 void Rebuild( vlc_bool_t );
945 void UpdateNode( playlist_item_t*, wxTreeItemId );
946 void UpdateNodeChildren( playlist_item_t*, wxTreeItemId );
947 void CreateNode( playlist_item_t*, wxTreeItemId );
948 void UpdateTreeItem( wxTreeItemId );
950 /* Search (internal) */
951 int CountItems( wxTreeItemId);
952 wxTreeItemId FindItem( wxTreeItemId, int );
953 wxTreeItemId FindItemByName( wxTreeItemId, wxString,
954 wxTreeItemId, vlc_bool_t *);
956 wxTreeItemId saved_tree_item;
959 playlist_t *p_playlist;
963 void OnPlaylistEvent( wxCommandEvent& event );
965 DECLARE_EVENT_TABLE();
969 wxStatusBar *statusbar;
970 ItemInfoDialog *iteminfo_dialog;
972 int i_update_counter;
974 intf_thread_t *p_intf;
975 wxTreeCtrl *treectrl;
977 vlc_bool_t b_changed_view;
983 /* ItemInfo Dialog */
984 class ItemInfoDialog: public wxDialog
988 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
989 wxWindow *p_parent );
990 virtual ~ItemInfoDialog();
992 wxArrayString GetOptions();
995 wxPanel *InfoPanel( wxWindow* parent );
996 wxPanel *GroupPanel( wxWindow* parent );
998 /* Event handlers (these functions should _not_ be virtual) */
999 void OnOk( wxCommandEvent& event );
1000 void OnCancel( wxCommandEvent& event );
1004 DECLARE_EVENT_TABLE();
1006 intf_thread_t *p_intf;
1007 playlist_item_t *p_item;
1010 /* Controls for the iteminfo dialog box */
1011 wxPanel *info_subpanel;
1012 wxPanel *info_panel;
1014 wxPanel *group_subpanel;
1015 wxPanel *group_panel;
1017 wxTextCtrl *uri_text;
1018 wxTextCtrl *name_text;
1020 wxTreeCtrl *info_tree;
1021 wxTreeItemId info_root;
1027 class FileInfo: public wxFrame
1031 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
1032 virtual ~FileInfo();
1033 void UpdateFileInfo();
1035 vlc_bool_t b_need_update;
1038 void OnButtonClose( wxCommandEvent& event );
1039 void OnClose( wxCloseEvent& WXUNUSED(event) );
1041 DECLARE_EVENT_TABLE();
1043 intf_thread_t *p_intf;
1044 wxTreeCtrl *fileinfo_tree;
1045 wxTreeItemId fileinfo_root;
1046 wxString fileinfo_root_label;
1050 #if wxUSE_DRAG_AND_DROP
1051 /* Drag and Drop class */
1052 class DragAndDrop: public wxFileDropTarget
1055 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
1057 virtual bool OnDropFiles( wxCoord x, wxCoord y,
1058 const wxArrayString& filenames );
1061 intf_thread_t *p_intf;
1062 vlc_bool_t b_enqueue;
1065 } // end of wxvlc namespace
1068 class WindowSettings
1071 WindowSettings( intf_thread_t *_p_intf );
1072 virtual ~WindowSettings();
1086 void SetSettings( int id, bool _b_shown,
1087 wxPoint p = wxDefaultPosition, wxSize s = wxDefaultSize );
1088 bool GetSettings( int id, bool& _b_shown, wxPoint& p, wxSize& s );
1090 void SetScreen( int i_screen_w, int i_screen_h );
1093 intf_thread_t *p_intf;
1097 bool b_valid[ID_MAX];
1098 bool b_shown[ID_MAX];
1099 wxPoint position[ID_MAX];
1100 wxSize size[ID_MAX];
1104 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
1105 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1106 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1107 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1108 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1112 class MenuEvtHandler : public wxEvtHandler
1115 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
1116 virtual ~MenuEvtHandler();
1118 void OnMenuEvent( wxCommandEvent& event );
1119 void OnShowDialog( wxCommandEvent& event );
1123 DECLARE_EVENT_TABLE()
1125 intf_thread_t *p_intf;
1126 Interface *p_main_interface;
1129 } // end of wxvlc namespace
1133 * wxWindows keeps dead locking because the timer tries to lock the playlist
1134 * when it's already locked somewhere else in the very wxWindows interface
1135 * module. Unless someone implements a "vlc_mutex_trylock", we need that.
1137 inline void LockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1139 if( p_sys->i_playlist_usage++ == 0)
1140 vlc_mutex_lock( &p_pl->object_lock );
1143 inline void UnlockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1145 if( --p_sys->i_playlist_usage == 0)
1146 vlc_mutex_unlock( &p_pl->object_lock );
1149 using namespace wxvlc;