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;
670 wxCheckBox *sout_all_checkbox;
673 /* Subtitles File Dialog */
674 class SubsFileDialog: public wxDialog
678 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
679 virtual ~SubsFileDialog();
681 wxComboBox *file_combo;
682 wxComboBox *encoding_combo;
683 wxComboBox *size_combo;
684 wxComboBox *align_combo;
685 wxSpinCtrl *fps_spinctrl;
686 wxSpinCtrl *delay_spinctrl;
689 /* Event handlers (these functions should _not_ be virtual) */
690 void OnOk( wxCommandEvent& event );
691 void OnCancel( wxCommandEvent& event );
692 void OnFileBrowse( wxCommandEvent& event );
694 DECLARE_EVENT_TABLE();
696 intf_thread_t *p_intf;
701 class StreamDialog: public wxFrame
705 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
706 virtual ~StreamDialog();
709 void OnClose( wxCommandEvent& event );
710 void OnOpen( wxCommandEvent& event );
711 void OnSout( wxCommandEvent& event );
712 void OnStart( wxCommandEvent& event );
714 DECLARE_EVENT_TABLE();
716 intf_thread_t *p_intf;
718 wxStaticText *step2_label;
719 wxStaticText *step3_label;
720 wxButton *sout_button;
721 wxButton *start_button;
723 wxArrayString sout_mrl;
724 OpenDialog *p_open_dialog;
725 SoutDialog *p_sout_dialog;
729 class WizardDialog : public wxWizard
733 WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent,char *, int, int );
734 virtual ~WizardDialog();
735 void SetTranscode( char *vcodec, int vb, char *acodec,int ab);
736 void SetMrl( const char *mrl );
737 void SetTTL( int i_ttl );
738 void SetPartial( int, int );
739 void SetStream( char *method, char *address );
740 void SetTranscodeOut( const char *address );
741 void SetAction( int i_action );
743 void SetSAP( bool b_enabled, const char *psz_name );
744 void SetMux( char *mux );
751 int i_from, i_to, i_ttl;
752 char *vcodec , *acodec , *address , *mrl , *mux ;
755 DECLARE_EVENT_TABLE();
757 intf_thread_t *p_intf;
761 /* Preferences Dialog */
762 class PrefsDialog: public wxFrame
766 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
767 virtual ~PrefsDialog();
770 wxPanel *PrefsPanel( wxWindow* parent );
772 /* Event handlers (these functions should _not_ be virtual) */
773 void OnOk( wxCommandEvent& event );
774 void OnCancel( wxCommandEvent& event );
775 void OnSave( wxCommandEvent& event );
776 void OnResetAll( wxCommandEvent& event );
777 void OnAdvanced( wxCommandEvent& event );
779 DECLARE_EVENT_TABLE();
781 intf_thread_t *p_intf;
783 PrefsTreeCtrl *prefs_tree;
787 class Messages: public wxFrame
791 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
793 bool Show( bool show = TRUE );
797 /* Event handlers (these functions should _not_ be virtual) */
798 void OnClose( wxCommandEvent& event );
799 void OnClear( wxCommandEvent& event );
800 void OnSaveLog( wxCommandEvent& event );
802 DECLARE_EVENT_TABLE();
804 intf_thread_t *p_intf;
805 wxTextCtrl *textctrl;
806 wxTextAttr *info_attr;
807 wxTextAttr *err_attr;
808 wxTextAttr *warn_attr;
809 wxTextAttr *dbg_attr;
811 wxFileDialog *save_log_dialog;
813 vlc_bool_t b_verbose;
817 class Playlist: public wxFrame
821 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
824 void UpdatePlaylist();
825 void ShowPlaylist( bool show );
826 void UpdateItem( int );
827 void AppendItem( wxCommandEvent& );
832 void RemoveItem( int );
833 void DeleteItem( int item );
834 void DeleteNode( playlist_item_t *node );
836 /* Event handlers (these functions should _not_ be virtual) */
839 void OnAddFile( wxCommandEvent& event );
840 void OnAddDir( wxCommandEvent& event );
841 void OnAddMRL( wxCommandEvent& event );
842 void OnClose( wxCommandEvent& event );
844 void OnEnableSelection( wxCommandEvent& event );
845 void OnDisableSelection( wxCommandEvent& event );
846 void OnInvertSelection( wxCommandEvent& event );
847 void OnDeleteSelection( wxCommandEvent& event );
848 void OnSelectAll( wxCommandEvent& event );
850 void OnOpen( wxCommandEvent& event );
851 void OnSave( wxCommandEvent& event );
854 void OnSearch( wxCommandEvent& event );
855 void OnSearchTextChange( wxCommandEvent& event );
856 wxTextCtrl *search_text;
857 wxButton *search_button;
858 wxTreeItemId search_current;
860 void OnEnDis( wxCommandEvent& event );
864 void OnSort( wxCommandEvent& event );
867 int i_duration_sorted;
870 void OnMenuEvent( wxCommandEvent& event );
871 void OnMenuOpen( wxMenuEvent& event );
877 void OnUp( wxCommandEvent& event);
878 void OnDown( wxCommandEvent& event);
880 void OnRandom( wxCommandEvent& event );
881 void OnRepeat( wxCommandEvent& event );
882 void OnLoop ( wxCommandEvent& event );
884 void OnActivateItem( wxTreeEvent& event );
885 void OnKeyDown( wxTreeEvent& event );
886 void OnNewGroup( wxCommandEvent& event );
891 wxTreeItemId i_popup_item;
892 playlist_item_t *p_popup_item;
893 playlist_item_t *p_popup_parent;
894 void OnPopup( wxContextMenuEvent& event );
895 void OnPopupPlay( wxMenuEvent& event );
896 void OnPopupPreparse( wxMenuEvent& event );
897 void OnPopupSort( wxMenuEvent& event );
898 void OnPopupDel( wxMenuEvent& event );
899 void OnPopupEna( wxMenuEvent& event );
900 void OnPopupInfo( wxMenuEvent& event );
901 void Rebuild( vlc_bool_t );
903 void Preparse( playlist_t *p_playlist );
906 void UpdateNode( playlist_t *, playlist_item_t*, wxTreeItemId );
907 void UpdateNodeChildren( playlist_t *, playlist_item_t*, wxTreeItemId );
908 void CreateNode( playlist_t *, playlist_item_t*, wxTreeItemId );
909 void UpdateTreeItem( playlist_t *, wxTreeItemId );
911 /* Search (internal) */
912 int CountItems( wxTreeItemId);
913 wxTreeItemId FindItem( wxTreeItemId, playlist_item_t * );
914 wxTreeItemId FindItem( wxTreeItemId, int );
915 wxTreeItemId FindItemByName( wxTreeItemId, wxString,
916 wxTreeItemId, vlc_bool_t *);
918 wxTreeItemId saved_tree_item;
919 playlist_item_t *p_saved_item;
923 void OnPlaylistEvent( wxCommandEvent& event );
925 DECLARE_EVENT_TABLE();
929 wxStatusBar *statusbar;
930 ItemInfoDialog *iteminfo_dialog;
932 int i_update_counter;
934 intf_thread_t *p_intf;
935 wxTreeCtrl *treectrl;
937 vlc_bool_t b_changed_view;
943 /* ItemInfo Dialog */
944 class ItemInfoDialog: public wxDialog
948 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
949 wxWindow *p_parent );
950 virtual ~ItemInfoDialog();
952 wxArrayString GetOptions();
955 wxPanel *InfoPanel( wxWindow* parent );
956 wxPanel *GroupPanel( wxWindow* parent );
958 /* Event handlers (these functions should _not_ be virtual) */
959 void OnOk( wxCommandEvent& event );
960 void OnCancel( wxCommandEvent& event );
964 DECLARE_EVENT_TABLE();
966 intf_thread_t *p_intf;
967 playlist_item_t *p_item;
970 /* Controls for the iteminfo dialog box */
971 wxPanel *info_subpanel;
974 wxPanel *group_subpanel;
975 wxPanel *group_panel;
977 wxTextCtrl *uri_text;
978 wxTextCtrl *name_text;
980 wxTreeCtrl *info_tree;
981 wxTreeItemId info_root;
987 class FileInfo: public wxFrame
991 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
993 void UpdateFileInfo();
995 vlc_bool_t b_need_update;
998 void OnClose( wxCommandEvent& event );
1000 DECLARE_EVENT_TABLE();
1002 intf_thread_t *p_intf;
1003 wxTreeCtrl *fileinfo_tree;
1004 wxTreeItemId fileinfo_root;
1005 wxString fileinfo_root_label;
1009 #if wxUSE_DRAG_AND_DROP
1010 /* Drag and Drop class */
1011 class DragAndDrop: public wxFileDropTarget
1014 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
1016 virtual bool OnDropFiles( wxCoord x, wxCoord y,
1017 const wxArrayString& filenames );
1020 intf_thread_t *p_intf;
1021 vlc_bool_t b_enqueue;
1024 } // end of wxvlc namespace
1027 class WindowSettings
1030 WindowSettings( intf_thread_t *_p_intf );
1031 virtual ~WindowSettings();
1044 void SetSettings( int id, bool _b_shown,
1045 wxPoint p = wxDefaultPosition, wxSize s = wxDefaultSize );
1046 bool GetSettings( int id, bool& _b_shown, wxPoint& p, wxSize& s );
1048 void SetScreen( int i_screen_w, int i_screen_h );
1051 intf_thread_t *p_intf;
1055 bool b_valid[ID_MAX];
1056 bool b_shown[ID_MAX];
1057 wxPoint position[ID_MAX];
1058 wxSize size[ID_MAX];
1062 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
1063 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1064 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1065 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1066 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
1070 class MenuEvtHandler : public wxEvtHandler
1073 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
1074 virtual ~MenuEvtHandler();
1076 void OnMenuEvent( wxCommandEvent& event );
1077 void OnShowDialog( wxCommandEvent& event );
1081 DECLARE_EVENT_TABLE()
1083 intf_thread_t *p_intf;
1084 Interface *p_main_interface;
1087 } // end of wxvlc namespace
1091 * wxWindows keeps dead locking because the timer tries to lock the playlist
1092 * when it's already locked somewhere else in the very wxWindows interface
1093 * module. Unless someone implements a "vlc_mutex_trylock", we need that.
1095 inline void LockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1097 if( p_sys->i_playlist_usage++ == 0)
1098 vlc_mutex_lock( &p_pl->object_lock );
1101 inline void UnlockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
1103 if( --p_sys->i_playlist_usage == 0)
1104 vlc_mutex_unlock( &p_pl->object_lock );
1107 using namespace wxvlc;