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 /* Hmmm, work-around for newest wxWin */
49 #ifdef wxStaticCastEvent
50 # undef wxStaticCastEvent
51 # define wxStaticCastEvent(type, val) ((type)(val))
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 ) && defined( ENABLE_UTF8 )
62 # define wxU(utf8) wxString(utf8, wxConvUTF8)
64 # define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
68 #else // ENABLE_NLS && ENABLE_UTF8
70 # define wxU(ansi) wxString(ansi, wxConvLocal)
72 # define wxU(ansi) (ansi)
78 /* wxL2U (locale to unicode) is used to convert ansi strings to unicode
79 * strings (wchar_t) */
80 #define wxL2U(ansi) wxU(ansi)
92 class DialogsProvider;
98 /*****************************************************************************
99 * intf_sys_t: description and status of wxwindows interface
100 *****************************************************************************/
103 /* the wx parent window */
104 wxWindow *p_wxwindow;
107 /* window settings */
108 WindowSettings *p_window_settings;
110 /* special actions */
111 vlc_bool_t b_playing;
112 vlc_bool_t b_intf_show; /* interface to be shown */
114 /* The input thread */
115 input_thread_t * p_input;
118 int i_slider_pos; /* slider position */
119 int i_slider_oldpos; /* previous position */
120 vlc_bool_t b_slider_free; /* slider status */
122 /* The messages window */
123 msg_subscription_t* p_sub; /* message bank subscription */
125 /* Playlist management */
126 int i_playing; /* playlist selected item */
127 unsigned i_playlist_usage;
129 /* Send an event to show a dialog */
130 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
131 intf_dialog_args_t *p_arg );
134 wxMenu *p_popup_menu;
137 int i_first_hotkey_event;
141 VideoWindow *p_video_window;
142 wxBoxSizer *p_video_sizer;
145 aout_instance_t *p_aout;
148 /*****************************************************************************
150 *****************************************************************************/
151 wxArrayString SeparateEntries( wxString );
152 wxWindow *CreateVideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
153 wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
154 wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
161 class SubsFileDialog;
167 class ItemInfoDialog;
169 class ExportPlaylist;
171 /*****************************************************************************
172 * Classes declarations.
173 *****************************************************************************/
175 class Timer: public wxTimer
179 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
182 virtual void Notify();
185 intf_thread_t *p_intf;
186 Interface *p_main_interface;
188 int i_old_playing_status;
190 vlc_bool_t b_old_seekable;
191 vlc_bool_t b_disc_shown;
196 class ExtraPanel: public wxPanel
200 ExtraPanel( intf_thread_t *p_intf, wxWindow *p_parent );
201 virtual ~ExtraPanel();
203 wxStaticBox *adjust_box;
204 wxButton *restoredefaults_button;
205 wxSlider *brightness_slider;
206 wxSlider *contrast_slider;
207 wxSlider *saturation_slider;
208 wxSlider *hue_slider;
209 wxSlider *gamma_slider;
211 wxStaticBox *other_box;
212 wxComboBox *ratio_combo;
220 wxPanel *VideoPanel( wxWindow * );
221 wxPanel *EqzPanel( wxWindow * );
222 wxPanel *AudioPanel( wxWindow * );
224 wxNotebook *notebook;
226 wxCheckBox *eq_chkbox;
228 wxCheckBox *eq_2p_chkbox;
230 wxSlider *smooth_slider;
232 wxSlider *preamp_slider;
233 wxStaticText * preamp_text;
238 wxSlider *band_sliders[10];
239 wxStaticText *band_texts[10];
245 /* Event handlers (these functions should _not_ be virtual) */
247 void OnEnableAdjust( wxCommandEvent& );
248 void OnEnableEqualizer( wxCommandEvent& );
249 void OnRestoreDefaults( wxCommandEvent& );
250 void OnChangeEqualizer( wxScrollEvent& );
251 void OnAdjustUpdate( wxScrollEvent& );
252 void OnRatio( wxCommandEvent& );
253 void OnFiltersInfo( wxCommandEvent& );
254 void OnSelectFilter( wxCommandEvent& );
256 void OnEqSmooth( wxScrollEvent& );
257 void OnPreamp( wxScrollEvent& );
258 void OnEq2Pass( wxCommandEvent& );
259 void OnEqRestore( wxCommandEvent& );
261 void OnHeadphone( wxCommandEvent& );
262 void OnNormvol( wxCommandEvent& );
263 void OnNormvolSlider( wxScrollEvent& );
265 void OnIdle( wxIdleEvent& );
267 DECLARE_EVENT_TABLE();
269 intf_thread_t *p_intf;
270 vlc_bool_t b_my_update;
274 /* Extended Window */
275 class ExtraWindow: public wxFrame
279 ExtraWindow( intf_thread_t *p_intf, wxWindow *p_parent, wxPanel *panel );
280 virtual ~ExtraWindow();
286 DECLARE_EVENT_TABLE();
288 intf_thread_t *p_intf;
292 /* Systray integration */
293 #ifdef wxHAS_TASK_BAR_ICON
294 class Systray: public wxTaskBarIcon
297 Systray( Interface* p_main_interface );
298 virtual ~Systray() {};
299 wxMenu* CreatePopupMenu();
300 void UpdateTooltip( const wxChar* tooltip );
303 void OnLeftClick( wxTaskBarIconEvent& event );
304 void OnPlayStream ( wxCommandEvent& event );
305 void OnStopStream ( wxCommandEvent& event );
306 void OnPrevStream ( wxCommandEvent& event );
307 void OnNextStream ( wxCommandEvent& event );
308 void OnExit( wxCommandEvent& event );
309 Interface* p_main_interface;
310 DECLARE_EVENT_TABLE()
315 class Interface: public wxFrame
319 Interface( intf_thread_t *p_intf, long style = wxDEFAULT_FRAME_STYLE );
320 virtual ~Interface();
322 void TogglePlayButton( int i_playing_status );
329 wxBoxSizer *frame_sizer;
330 wxStatusBar *statusbar;
333 wxWindow *slider_frame;
334 wxBoxSizer *slider_sizer;
335 wxPanel *extra_frame;
338 wxBoxSizer *disc_sizer;
339 wxBitmapButton *disc_menu_button;
340 wxBitmapButton *disc_prev_button;
341 wxBitmapButton *disc_next_button;
343 wxFrame *extra_window;
350 #ifdef wxHAS_TASK_BAR_ICON
356 void CreateOurMenuBar();
357 void CreateOurToolBar();
358 void CreateOurExtendedPanel();
359 void CreateOurSlider();
360 void Open( int i_access_method );
362 /* Event handlers (these functions should _not_ be virtual) */
363 void OnExit( wxCommandEvent& event );
364 void OnAbout( wxCommandEvent& event );
366 void OnOpenFileSimple( wxCommandEvent& event );
367 void OnOpenDir( wxCommandEvent& event );
368 void OnOpenFile( wxCommandEvent& event );
369 void OnOpenDisc( wxCommandEvent& event );
370 void OnOpenNet( wxCommandEvent& event );
371 void OnOpenSat( wxCommandEvent& event );
373 void OnExtended( wxCommandEvent& event );
374 //void OnUndock( wxCommandEvent& event );
376 void OnBookmarks( wxCommandEvent& event );
377 void OnShowDialog( wxCommandEvent& event );
378 void OnPlayStream( wxCommandEvent& event );
379 void OnStopStream( wxCommandEvent& event );
380 void OnSliderUpdate( wxScrollEvent& event );
381 void OnPrevStream( wxCommandEvent& event );
382 void OnNextStream( wxCommandEvent& event );
383 void OnSlowStream( wxCommandEvent& event );
384 void OnFastStream( wxCommandEvent& event );
386 void OnDiscMenu( wxCommandEvent& event );
387 void OnDiscPrev( wxCommandEvent& event );
388 void OnDiscNext( wxCommandEvent& event );
390 void OnMenuOpen( wxMenuEvent& event );
392 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
393 void OnContextMenu2(wxContextMenuEvent& event);
395 void OnContextMenu(wxMouseEvent& event);
397 void OnControlEvent( wxCommandEvent& event );
399 DECLARE_EVENT_TABLE();
402 intf_thread_t *p_intf;
405 int i_old_playing_status;
407 /* For auto-generated menus */
408 wxMenu *p_settings_menu;
409 wxMenu *p_audio_menu;
410 wxMenu *p_video_menu;
411 wxMenu *p_navig_menu;
415 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
416 class OpenDialog: public wxDialog
420 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
421 int i_access_method, int i_arg = 0 );
423 /* Extended Contructor */
424 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
425 int i_access_method, int i_arg = 0 , int _i_method = 0 );
426 virtual ~OpenDialog();
429 int Show( int i_access_method, int i_arg = 0 );
432 void UpdateMRL( int i_access_method );
437 wxPanel *FilePanel( wxWindow* parent );
438 wxPanel *DiscPanel( wxWindow* parent );
439 wxPanel *NetPanel( wxWindow* parent );
441 ArrayOfAutoBuiltPanel input_tab_array;
443 /* Event handlers (these functions should _not_ be virtual) */
444 void OnOk( wxCommandEvent& event );
445 void OnCancel( wxCommandEvent& event );
447 void OnPageChange( wxNotebookEvent& event );
448 void OnMRLChange( wxCommandEvent& event );
450 /* Event handlers for the file page */
451 void OnFilePanelChange( wxCommandEvent& event );
452 void OnFileBrowse( wxCommandEvent& event );
454 /* Event handlers for the disc page */
455 void OnDiscPanelChange( wxCommandEvent& event );
456 void OnDiscTypeChange( wxCommandEvent& event );
457 void OnDiscDeviceChange( wxCommandEvent& event );
459 /* Event handlers for the net page */
460 void OnNetPanelChange( wxCommandEvent& event );
461 void OnNetTypeChange( wxCommandEvent& event );
463 /* Event handlers for the stream output */
464 void OnSubsFileEnable( wxCommandEvent& event );
465 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
467 /* Event handlers for the stream output */
468 void OnSoutEnable( wxCommandEvent& event );
469 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
471 /* Event handlers for the caching option */
472 void OnCachingEnable( wxCommandEvent& event );
473 void OnCachingChange( wxCommandEvent& event );
475 DECLARE_EVENT_TABLE();
477 intf_thread_t *p_intf;
479 int i_current_access_method;
480 int i_disc_type_selection;
482 int i_method; /* Normal or for the stream dialog ? */
485 wxComboBox *mrl_combo;
486 wxNotebook *notebook;
488 /* Controls for the file panel */
489 wxComboBox *file_combo;
490 wxFileDialog *file_dialog;
492 /* Controls for the disc panel */
493 wxRadioBox *disc_type;
494 wxTextCtrl *disc_device;
495 wxSpinCtrl *disc_title; int i_disc_title;
496 wxSpinCtrl *disc_chapter; int i_disc_chapter;
497 wxSpinCtrl *disc_sub; int i_disc_sub;
499 /* The media equivalent name for a DVD names. For example,
500 * "Title", is "Track" for a CD-DA */
501 wxStaticText *disc_title_label;
502 wxStaticText *disc_chapter_label;
503 wxStaticText *disc_sub_label;
505 /* Indicates if the disc device control was modified */
506 bool b_disc_device_changed;
508 /* Controls for the net panel */
509 wxRadioBox *net_type;
511 wxPanel *net_subpanels[4];
512 wxRadioButton *net_radios[4];
513 wxSpinCtrl *net_ports[4];
515 wxTextCtrl *net_addrs[4];
516 wxCheckBox *net_timeshift;
517 wxCheckBox *net_ipv6;
519 /* Controls for the subtitles file */
520 wxButton *subsfile_button;
521 wxCheckBox *subsfile_checkbox;
522 SubsFileDialog *subsfile_dialog;
523 wxArrayString subsfile_mrl;
525 /* Controls for the stream output */
526 wxButton *sout_button;
527 wxCheckBox *sout_checkbox;
528 SoutDialog *sout_dialog;
529 wxArrayString sout_mrl;
531 /* Controls for the caching options */
532 wxCheckBox *caching_checkbox;
533 wxSpinCtrl *caching_value;
543 /* Auto-built panels */
546 #define MAX_ACCESS CAPTURE_ACCESS
548 /* Stream output Dialog */
561 TS_ENCAPSULATION = 0,
580 class SoutDialog: public wxDialog
584 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
585 virtual ~SoutDialog();
587 wxArrayString GetOptions();
591 wxPanel *AccessPanel( wxWindow* parent );
592 wxPanel *MiscPanel( wxWindow* parent );
593 wxPanel *EncapsulationPanel( wxWindow* parent );
594 wxPanel *TranscodingPanel( wxWindow* parent );
597 /* Event handlers (these functions should _not_ be virtual) */
598 void OnOk( wxCommandEvent& event );
599 void OnCancel( wxCommandEvent& event );
600 void OnMRLChange( wxCommandEvent& event );
601 void OnAccessTypeChange( wxCommandEvent& event );
603 /* Event handlers for the file access output */
604 void OnFileChange( wxCommandEvent& event );
605 void OnFileBrowse( wxCommandEvent& event );
606 void OnFileDump( wxCommandEvent& event );
608 /* Event handlers for the net access output */
609 void OnNetChange( wxCommandEvent& event );
611 /* Event specific to the announce address */
612 void OnAnnounceGroupChange( wxCommandEvent& event );
613 void OnAnnounceAddrChange( wxCommandEvent& event );
615 /* Event handlers for the encapsulation panel */
616 void OnEncapsulationChange( wxCommandEvent& event );
618 /* Event handlers for the transcoding panel */
619 void OnTranscodingEnable( wxCommandEvent& event );
620 void OnTranscodingChange( wxCommandEvent& event );
622 /* Event handlers for the misc panel */
623 void OnSAPMiscChange( wxCommandEvent& event );
624 void OnSLPMiscChange( wxCommandEvent& event );
626 DECLARE_EVENT_TABLE();
628 intf_thread_t *p_intf;
631 wxComboBox *mrl_combo;
633 /* Controls for the access outputs */
634 wxPanel *access_panel;
635 wxPanel *access_subpanels[ACCESS_OUT_NUM];
636 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
640 wxComboBox *file_combo;
641 wxCheckBox *dump_checkbox;
642 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
643 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
645 /* Controls for the SAP announces */
647 wxPanel *misc_subpanels[MISC_SOUT_NUM];
648 wxCheckBox *sap_checkbox;
649 wxCheckBox *slp_checkbox;
650 wxTextCtrl *announce_group;
651 wxTextCtrl *announce_addr;
653 /* Controls for the encapsulation */
654 wxPanel *encapsulation_panel;
655 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
656 int i_encapsulation_type;
658 /* Controls for transcoding */
659 wxPanel *transcoding_panel;
660 wxCheckBox *video_transc_checkbox;
661 wxComboBox *video_codec_combo;
662 wxComboBox *audio_codec_combo;
663 wxCheckBox *audio_transc_checkbox;
664 wxComboBox *video_bitrate_combo;
665 wxComboBox *audio_bitrate_combo;
666 wxComboBox *audio_channels_combo;
667 wxComboBox *video_scale_combo;
668 wxComboBox *subtitles_codec_combo;
669 wxCheckBox *subtitles_transc_checkbox;
670 wxCheckBox *subtitles_overlay_checkbox;
673 wxCheckBox *sout_all_checkbox;
676 /* Subtitles File Dialog */
677 class SubsFileDialog: public wxDialog
681 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
682 virtual ~SubsFileDialog();
684 wxComboBox *file_combo;
685 wxComboBox *encoding_combo;
686 wxComboBox *size_combo;
687 wxComboBox *align_combo;
688 wxSpinCtrl *fps_spinctrl;
689 wxSpinCtrl *delay_spinctrl;
692 /* Event handlers (these functions should _not_ be virtual) */
693 void OnOk( wxCommandEvent& event );
694 void OnCancel( wxCommandEvent& event );
695 void OnFileBrowse( wxCommandEvent& event );
697 DECLARE_EVENT_TABLE();
699 intf_thread_t *p_intf;
704 class StreamDialog: public wxFrame
708 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
709 virtual ~StreamDialog();
712 void OnClose( wxCommandEvent& event );
713 void OnOpen( wxCommandEvent& event );
714 void OnSout( wxCommandEvent& event );
715 void OnStart( wxCommandEvent& event );
717 DECLARE_EVENT_TABLE();
719 intf_thread_t *p_intf;
721 wxStaticText *step2_label;
722 wxStaticText *step3_label;
723 wxButton *sout_button;
724 wxButton *start_button;
726 wxArrayString sout_mrl;
727 OpenDialog *p_open_dialog;
728 SoutDialog *p_sout_dialog;
732 class WizardDialog : public wxWizard
736 WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent,char *, int, int );
737 virtual ~WizardDialog();
738 void SetTranscode( char *vcodec, int vb, char *acodec,int ab);
739 void SetMrl( const char *mrl );
740 void SetTTL( int i_ttl );
741 void SetPartial( int, int );
742 void SetStream( char *method, char *address );
743 void SetTranscodeOut( const char *address );
744 void SetAction( int i_action );
746 void SetSAP( bool b_enabled, const char *psz_name );
747 void SetMux( char *mux );
754 int i_from, i_to, i_ttl;
755 char *vcodec , *acodec , *address , *mrl , *mux ;
758 DECLARE_EVENT_TABLE();
760 intf_thread_t *p_intf;
764 /* Preferences Dialog */
765 class PrefsDialog: public wxFrame
769 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
770 virtual ~PrefsDialog();
773 wxPanel *PrefsPanel( wxWindow* parent );
775 /* Event handlers (these functions should _not_ be virtual) */
776 void OnOk( wxCommandEvent& event );
777 void OnCancel( wxEvent& event );
778 void OnSave( wxCommandEvent& event );
779 void OnResetAll( wxCommandEvent& event );
780 void OnAdvanced( wxCommandEvent& event );
782 DECLARE_EVENT_TABLE();
784 intf_thread_t *p_intf;
786 PrefsTreeCtrl *prefs_tree;
790 class Messages: public wxFrame
794 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
796 bool Show( bool show = TRUE );
800 /* Event handlers (these functions should _not_ be virtual) */
801 void OnClose( wxEvent& event );
802 void OnClear( wxCommandEvent& event );
803 void OnSaveLog( wxCommandEvent& event );
805 DECLARE_EVENT_TABLE();
807 intf_thread_t *p_intf;
808 wxTextCtrl *textctrl;
809 wxTextAttr *info_attr;
810 wxTextAttr *err_attr;
811 wxTextAttr *warn_attr;
812 wxTextAttr *dbg_attr;
814 wxFileDialog *save_log_dialog;
816 vlc_bool_t b_verbose;
820 class Playlist: public wxFrame
824 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
827 void UpdatePlaylist();
828 void ShowPlaylist( bool show );
829 void UpdateItem( int );
830 void AppendItem( wxCommandEvent& );
835 void RemoveItem( int );
836 void DeleteItem( int item );
837 void DeleteNode( playlist_item_t *node );
839 /* Event handlers (these functions should _not_ be virtual) */
842 void OnAddFile( wxCommandEvent& event );
843 void OnAddDir( wxCommandEvent& event );
844 void OnAddMRL( wxCommandEvent& event );
845 void OnClose( wxCloseEvent& event );
847 void OnEnableSelection( wxCommandEvent& event );
848 void OnDisableSelection( wxCommandEvent& event );
849 void OnInvertSelection( wxCommandEvent& event );
850 void OnDeleteSelection( wxCommandEvent& event );
851 void OnSelectAll( wxCommandEvent& event );
853 void OnOpen( wxCommandEvent& event );
854 void OnSave( wxCommandEvent& event );
857 void OnSearch( wxCommandEvent& event );
858 void OnSearchTextChange( wxCommandEvent& event );
859 wxTextCtrl *search_text;
860 wxButton *search_button;
861 wxTreeItemId search_current;
863 void OnEnDis( wxCommandEvent& event );
867 void OnSort( wxCommandEvent& event );
870 int i_duration_sorted;
873 void OnMenuEvent( wxCommandEvent& event );
874 void OnMenuOpen( wxMenuEvent& event );
880 void OnUp( wxCommandEvent& event);
881 void OnDown( wxCommandEvent& event);
883 void OnRandom( wxCommandEvent& event );
884 void OnRepeat( wxCommandEvent& event );
885 void OnLoop ( wxCommandEvent& event );
887 void OnActivateItem( wxTreeEvent& event );
888 void OnKeyDown( wxTreeEvent& event );
889 void OnNewGroup( wxCommandEvent& event );
894 wxTreeItemId i_popup_item;
895 playlist_item_t *p_popup_item;
896 playlist_item_t *p_popup_parent;
897 void OnPopup( wxContextMenuEvent& event );
898 void OnPopupPlay( wxCommandEvent& event );
899 void OnPopupPreparse( wxCommandEvent& event );
900 void OnPopupSort( wxCommandEvent& event );
901 void OnPopupDel( wxCommandEvent& event );
902 void OnPopupEna( wxCommandEvent& event );
903 void OnPopupInfo( wxCommandEvent& event );
904 void Rebuild( vlc_bool_t );
906 void Preparse( playlist_t *p_playlist );
909 void UpdateNode( playlist_t *, playlist_item_t*, wxTreeItemId );
910 void UpdateNodeChildren( playlist_t *, playlist_item_t*, wxTreeItemId );
911 void CreateNode( playlist_t *, playlist_item_t*, wxTreeItemId );
912 void UpdateTreeItem( playlist_t *, wxTreeItemId );
914 /* Search (internal) */
915 int CountItems( wxTreeItemId);
916 wxTreeItemId FindItem( wxTreeItemId, playlist_item_t * );
917 wxTreeItemId FindItem( wxTreeItemId, int );
918 wxTreeItemId FindItemByName( wxTreeItemId, wxString,
919 wxTreeItemId, vlc_bool_t *);
921 wxTreeItemId saved_tree_item;
922 playlist_item_t *p_saved_item;
926 void OnPlaylistEvent( wxCommandEvent& event );
928 DECLARE_EVENT_TABLE();
932 wxStatusBar *statusbar;
933 ItemInfoDialog *iteminfo_dialog;
935 int i_update_counter;
937 intf_thread_t *p_intf;
938 wxTreeCtrl *treectrl;
940 vlc_bool_t b_changed_view;
946 /* ItemInfo Dialog */
947 class ItemInfoDialog: public wxDialog
951 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
952 wxWindow *p_parent );
953 virtual ~ItemInfoDialog();
955 wxArrayString GetOptions();
958 wxPanel *InfoPanel( wxWindow* parent );
959 wxPanel *GroupPanel( wxWindow* parent );
961 /* Event handlers (these functions should _not_ be virtual) */
962 void OnOk( wxCommandEvent& event );
963 void OnCancel( wxCommandEvent& event );
967 DECLARE_EVENT_TABLE();
969 intf_thread_t *p_intf;
970 playlist_item_t *p_item;
973 /* Controls for the iteminfo dialog box */
974 wxPanel *info_subpanel;
977 wxPanel *group_subpanel;
978 wxPanel *group_panel;
980 wxTextCtrl *uri_text;
981 wxTextCtrl *name_text;
983 wxTreeCtrl *info_tree;
984 wxTreeItemId info_root;
990 class FileInfo: public wxFrame
994 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
996 void UpdateFileInfo();
998 vlc_bool_t b_need_update;
1001 void OnClose( wxCloseEvent& event );
1003 DECLARE_EVENT_TABLE();
1005 intf_thread_t *p_intf;
1006 wxTreeCtrl *fileinfo_tree;
1007 wxTreeItemId fileinfo_root;
1008 wxString fileinfo_root_label;
1012 #if wxUSE_DRAG_AND_DROP
1013 /* Drag and Drop class */
1014 class DragAndDrop: public wxFileDropTarget
1017 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
1019 virtual bool OnDropFiles( wxCoord x, wxCoord y,
1020 const wxArrayString& filenames );
1023 intf_thread_t *p_intf;
1024 vlc_bool_t b_enqueue;
1027 } // end of wxvlc namespace
1030 class WindowSettings
1033 WindowSettings( intf_thread_t *_p_intf );
1034 virtual ~WindowSettings();
1047 void SetSettings( int id, bool _b_shown,
1048 wxPoint p = wxDefaultPosition, wxSize s = wxDefaultSize );
1049 bool GetSettings( int id, bool& _b_shown, wxPoint& p, wxSize& s );
1051 void SetScreen( int i_screen_w, int i_screen_h );
1054 intf_thread_t *p_intf;
1058 bool b_valid[ID_MAX];
1059 bool b_shown[ID_MAX];
1060 wxPoint position[ID_MAX];
1061 wxSize size[ID_MAX];
1065 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
1066 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1067 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1068 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1069 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1073 class MenuEvtHandler : public wxEvtHandler
1076 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
1077 virtual ~MenuEvtHandler();
1079 void OnMenuEvent( wxCommandEvent& event );
1080 void OnShowDialog( wxCommandEvent& event );
1084 DECLARE_EVENT_TABLE()
1086 intf_thread_t *p_intf;
1087 Interface *p_main_interface;
1090 } // end of wxvlc namespace
1094 * wxWindows keeps dead locking because the timer tries to lock the playlist
1095 * when it's already locked somewhere else in the very wxWindows interface
1096 * module. Unless someone implements a "vlc_mutex_trylock", we need that.
1098 inline void LockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1100 if( p_sys->i_playlist_usage++ == 0)
1101 vlc_mutex_lock( &p_pl->object_lock );
1104 inline void UnlockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1106 if( --p_sys->i_playlist_usage == 0)
1107 vlc_mutex_unlock( &p_pl->object_lock );
1110 using namespace wxvlc;