1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999-2004 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>
47 /* Hmmm, work-around for newest wxWin */
48 #ifdef wxStaticCastEvent
49 # undef wxStaticCastEvent
50 # define wxStaticCastEvent(type, val) ((type)(val))
53 DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
54 DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
56 #define SLIDER_MAX_POS 10000
58 /* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
59 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
61 # define wxU(utf8) wxString(utf8, wxConvUTF8)
63 # define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
67 #else // ENABLE_NLS && ENABLE_UTF8
69 # define wxU(ansi) wxString(ansi, *wxConvCurrent)
71 # define wxU(ansi) ansi
77 /* wxL2U (locale to unicode) is used to convert ansi strings to unicode
78 * strings (wchar_t) */
80 # define wxL2U(ansi) wxString(ansi, *wxConvCurrent)
82 # define wxL2U(ansi) ansi
99 /*****************************************************************************
100 * intf_sys_t: description and status of wxwindows interface
101 *****************************************************************************/
104 /* the wx parent window */
105 wxWindow *p_wxwindow;
108 /* special actions */
109 vlc_bool_t b_playing;
111 /* The input thread */
112 input_thread_t * p_input;
115 int i_slider_pos; /* slider position */
116 int i_slider_oldpos; /* previous position */
117 vlc_bool_t b_slider_free; /* slider status */
119 /* The messages window */
120 msg_subscription_t* p_sub; /* message bank subscription */
122 /* Playlist management */
123 int i_playing; /* playlist selected item */
125 /* Send an event to show a dialog */
126 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
127 intf_dialog_args_t *p_arg );
130 wxMenu *p_popup_menu;
132 VideoWindow *p_video_window;
133 wxBoxSizer *p_video_sizer;
136 /*****************************************************************************
138 *****************************************************************************/
139 wxArrayString SeparateEntries( wxString );
140 wxWindow *VideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
141 wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
149 class SubsFileDialog;
155 class ItemInfoDialog;
157 class ExportPlaylist;
159 /*****************************************************************************
160 * Classes declarations.
161 *****************************************************************************/
163 class Timer: public wxTimer
167 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
170 virtual void Notify();
173 intf_thread_t *p_intf;
174 Interface *p_main_interface;
175 int i_old_playing_status;
180 class Interface: public wxFrame
184 Interface( intf_thread_t *p_intf );
185 virtual ~Interface();
186 void TogglePlayButton( int i_playing_status );
188 wxBoxSizer *frame_sizer;
189 wxStatusBar *statusbar;
192 wxWindow *slider_frame;
193 wxWindow *extra_frame;
197 wxStaticBox *adjust_box;
198 wxSlider *brightness_slider;
199 wxSlider *contrast_slider;
200 wxSlider *saturation_slider;
201 wxSlider *hue_slider;
202 wxSlider *gamma_slider;
204 wxStaticBox *other_box;
205 wxComboBox *ratio_combo;
210 void UpdateAcceleratorTable();
211 void CreateOurMenuBar();
212 void CreateOurToolBar();
213 void CreateOurExtendedPanel();
214 void CreateOurSlider();
215 void Open( int i_access_method );
217 /* Event handlers (these functions should _not_ be virtual) */
218 void OnExit( wxCommandEvent& event );
219 void OnAbout( wxCommandEvent& event );
221 void OnOpenFileSimple( wxCommandEvent& event );
222 void OnOpenFile( wxCommandEvent& event );
223 void OnOpenDisc( wxCommandEvent& event );
224 void OnOpenNet( wxCommandEvent& event );
225 void OnOpenSat( wxCommandEvent& event );
226 void OnOpenV4L( wxCommandEvent& event );
227 void OnExtended( wxCommandEvent& event );
228 void OnBookmarks( wxCommandEvent& event );
229 void OnShowDialog( wxCommandEvent& event );
230 void OnPlayStream( wxCommandEvent& event );
231 void OnStopStream( wxCommandEvent& event );
232 void OnSliderUpdate( wxScrollEvent& event );
233 void OnPrevStream( wxCommandEvent& event );
234 void OnNextStream( wxCommandEvent& event );
235 void OnSlowStream( wxCommandEvent& event );
236 void OnFastStream( wxCommandEvent& event );
238 void OnEnableAdjust( wxCommandEvent& event );
239 void OnHueUpdate( wxScrollEvent& event );
240 void OnContrastUpdate( wxScrollEvent& event );
241 void OnBrightnessUpdate( wxScrollEvent& event );
242 void OnSaturationUpdate( wxScrollEvent& event );
243 void OnGammaUpdate( wxScrollEvent& event );
245 void OnRatio( wxCommandEvent& event );
246 void OnEnableVisual( wxCommandEvent& event );
248 void OnMenuOpen( wxMenuEvent& event );
250 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
251 void OnContextMenu2(wxContextMenuEvent& event);
253 void OnContextMenu(wxMouseEvent& event);
255 void OnControlEvent( wxCommandEvent& event );
257 DECLARE_EVENT_TABLE();
260 intf_thread_t *p_intf;
263 int i_old_playing_status;
265 /* For auto-generated menus */
266 wxMenu *p_settings_menu;
267 wxMenu *p_audio_menu;
268 wxMenu *p_video_menu;
269 wxMenu *p_navig_menu;
272 /*class BookmarksDialog;
274 /* Dialogs Provider */
275 class DialogsProvider: public wxFrame
279 DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
280 virtual ~DialogsProvider();
283 void Open( int i_access_method, int i_arg );
285 /* Event handlers (these functions should _not_ be virtual) */
286 void OnExit( wxCommandEvent& event );
287 void OnPlaylist( wxCommandEvent& event );
288 void OnMessages( wxCommandEvent& event );
289 void OnFileInfo( wxCommandEvent& event );
290 void OnPreferences( wxCommandEvent& event );
291 void OnStreamWizardDialog( wxCommandEvent& event );
292 void OnWizardDialog( wxCommandEvent& event );
293 void OnBookmarks( wxCommandEvent& event );
295 void OnOpenFileGeneric( wxCommandEvent& event );
296 void OnOpenFileSimple( wxCommandEvent& event );
297 void OnOpenFile( wxCommandEvent& event );
298 void OnOpenDisc( wxCommandEvent& event );
299 void OnOpenNet( wxCommandEvent& event );
300 void OnOpenSat( wxCommandEvent& event );
302 void OnPopupMenu( wxCommandEvent& event );
304 void OnIdle( wxIdleEvent& event );
306 void OnExitThread( wxCommandEvent& event );
308 DECLARE_EVENT_TABLE();
310 intf_thread_t *p_intf;
313 /* Secondary windows */
314 OpenDialog *p_open_dialog;
315 wxFileDialog *p_file_dialog;
316 Playlist *p_playlist_dialog;
317 Messages *p_messages_dialog;
318 FileInfo *p_fileinfo_dialog;
319 StreamDialog *p_streamwizard_dialog;
320 WizardDialog *p_wizard_dialog;
321 wxFrame *p_prefs_dialog;
322 wxWindow *p_bookmarks_dialog;
323 wxFileDialog *p_file_generic_dialog;
327 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
328 class OpenDialog: public wxFrame
332 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
333 int i_access_method, int i_arg = 0 );
335 /* Extended Contructor */
336 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
337 int i_access_method, int i_arg = 0 , int _i_method = 0 );
338 virtual ~OpenDialog();
341 int Show( int i_access_method, int i_arg = 0 );
344 void UpdateMRL( int i_access_method );
349 wxPanel *FilePanel( wxWindow* parent );
350 wxPanel *DiscPanel( wxWindow* parent );
351 wxPanel *NetPanel( wxWindow* parent );
352 wxPanel *V4LPanel( wxWindow* parent );
354 ArrayOfAutoBuiltPanel input_tab_array;
356 /* Event handlers (these functions should _not_ be virtual) */
357 void OnOk( wxCommandEvent& event );
358 void OnCancel( wxCommandEvent& event );
360 void OnPageChange( wxNotebookEvent& event );
361 void OnMRLChange( wxCommandEvent& event );
363 /* Event handlers for the file page */
364 void OnFilePanelChange( wxCommandEvent& event );
365 void OnFileBrowse( wxCommandEvent& event );
367 /* Event handlers for the disc page */
368 void OnDiscPanelChange( wxCommandEvent& event );
369 void OnDiscTypeChange( wxCommandEvent& event );
370 void OnDiscDeviceChange( wxCommandEvent& event );
372 /* Event handlers for the net page */
373 void OnNetPanelChange( wxCommandEvent& event );
374 void OnNetTypeChange( wxCommandEvent& event );
376 /* Event handlers for the v4l page */
377 void OnV4LPanelChange( wxCommandEvent& event );
378 void OnV4LTypeChange( wxCommandEvent& event );
379 void OnV4LSettingsChange( wxCommandEvent& event );
381 /* Event handlers for the stream output */
382 void OnSubsFileEnable( wxCommandEvent& event );
383 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
385 /* Event handlers for the stream output */
386 void OnSoutEnable( wxCommandEvent& event );
387 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
389 DECLARE_EVENT_TABLE();
391 intf_thread_t *p_intf;
393 int i_current_access_method;
394 int i_disc_type_selection;
396 int i_method; /* Normal or for the stream dialog ? */
399 wxComboBox *mrl_combo;
400 wxNotebook *notebook;
402 /* Controls for the file panel */
403 wxComboBox *file_combo;
404 wxFileDialog *file_dialog;
406 /* Controls for the disc panel */
407 wxRadioBox *disc_type;
408 wxTextCtrl *disc_device;
409 wxSpinCtrl *disc_title;
410 wxSpinCtrl *disc_chapter;
412 /* The media equivalent name for a DVD names. For example,
413 "Title", is "Track" for a CD-DA */
414 wxStaticText *disc_title_label;
415 wxStaticText *disc_chapter_label;
417 /* Indicates if the disc device control was modified */
418 bool b_disc_device_changed;
420 /* Controls for the net panel */
421 wxRadioBox *net_type;
423 wxPanel *net_subpanels[4];
424 wxRadioButton *net_radios[4];
425 wxSpinCtrl *net_ports[4];
427 wxTextCtrl *net_addrs[4];
428 wxCheckBox *net_ipv6;
430 /* Controls for the v4l panel */
431 wxRadioBox *video_type;
432 wxTextCtrl *video_device;
433 wxSpinCtrl *video_channel;
434 wxButton *v4l_button;
435 V4LDialog *v4l_dialog;
436 wxArrayString v4l_mrl;
438 /* Controls for the subtitles file */
439 wxButton *subsfile_button;
440 wxCheckBox *subsfile_checkbox;
441 SubsFileDialog *subsfile_dialog;
442 wxArrayString subsfile_mrl;
444 /* Controls for the stream output */
445 wxButton *sout_button;
446 wxCheckBox *sout_checkbox;
447 SoutDialog *sout_dialog;
448 wxArrayString sout_mrl;
464 class V4LDialog: public wxDialog
468 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
469 virtual ~V4LDialog();
471 wxArrayString GetOptions();
475 wxPanel *AudioPanel( wxWindow* parent );
476 wxPanel *CommonPanel( wxWindow* parent );
477 wxPanel *BitratePanel( wxWindow* parent );
480 /* Event handlers (these functions should _not_ be virtual) */
481 void OnOk( wxCommandEvent& event );
482 void OnCancel( wxCommandEvent& event );
483 void OnMRLChange( wxCommandEvent& event );
484 void OnAudioEnable( wxCommandEvent& event );
485 void OnAudioChange( wxCommandEvent& event );
486 void OnAudioChannel( wxCommandEvent& event );
487 void OnSizeEnable( wxCommandEvent& event );
488 void OnSize( wxCommandEvent& event );
489 void OnNormEnable( wxCommandEvent& event );
490 void OnNorm( wxCommandEvent& event );
491 void OnFrequencyEnable( wxCommandEvent& event );
492 void OnFrequency( wxCommandEvent& event );
493 void OnBitrateEnable( wxCommandEvent& event );
494 void OnBitrate( wxCommandEvent& event );
495 void OnMaxBitrateEnable( wxCommandEvent& event );
496 void OnMaxBitrate( wxCommandEvent& event );
498 DECLARE_EVENT_TABLE();
500 intf_thread_t *p_intf;
503 wxComboBox *mrl_combo;
507 /* Controls for the v4l advanced options */
508 wxPanel *common_subpanel;
509 wxPanel *common_panel;
510 wxCheckBox *size_checkbox;
511 wxComboBox *size_combo;
512 wxCheckBox *norm_checkbox;
513 wxComboBox *norm_combo;
514 wxCheckBox *frequency_checkbox;
515 wxSpinCtrl *frequency;
517 wxPanel *audio_subpanel;
518 wxPanel *audio_panel;
519 wxCheckBox *audio_checkbox;
520 wxTextCtrl *audio_device;
521 wxSpinCtrl *audio_channel;
523 wxPanel *bitrate_subpanel;
524 wxPanel *bitrate_panel;
525 wxCheckBox *bitrate_checkbox;
527 wxCheckBox *maxbitrate_checkbox;
528 wxSpinCtrl *maxbitrate;
532 /* Stream output Dialog */
546 TS_ENCAPSULATION = 0,
564 class SoutDialog: public wxDialog
568 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
569 virtual ~SoutDialog();
571 wxArrayString GetOptions();
575 wxPanel *AccessPanel( wxWindow* parent );
576 wxPanel *MiscPanel( wxWindow* parent );
577 wxPanel *EncapsulationPanel( wxWindow* parent );
578 wxPanel *TranscodingPanel( wxWindow* parent );
581 /* Event handlers (these functions should _not_ be virtual) */
582 void OnOk( wxCommandEvent& event );
583 void OnCancel( wxCommandEvent& event );
584 void OnMRLChange( wxCommandEvent& event );
585 void OnAccessTypeChange( wxCommandEvent& event );
587 /* Event handlers for the file access output */
588 void OnFileChange( wxCommandEvent& event );
589 void OnFileBrowse( wxCommandEvent& event );
590 void OnFileDump( wxCommandEvent& event );
592 /* Event handlers for the net access output */
593 void OnNetChange( wxCommandEvent& event );
595 /* Event specific to the announce address */
596 void OnAnnounceAddrChange( wxCommandEvent& event );
598 /* Event handlers for the encapsulation panel */
599 void OnEncapsulationChange( wxCommandEvent& event );
601 /* Event handlers for the transcoding panel */
602 void OnTranscodingEnable( wxCommandEvent& event );
603 void OnTranscodingChange( wxCommandEvent& event );
605 /* Event handlers for the misc panel */
606 void OnSAPMiscChange( wxCommandEvent& event );
607 void OnSLPMiscChange( wxCommandEvent& event );
609 DECLARE_EVENT_TABLE();
611 intf_thread_t *p_intf;
614 wxComboBox *mrl_combo;
616 /* Controls for the access outputs */
617 wxPanel *access_panel;
618 wxPanel *access_subpanels[ACCESS_OUT_NUM];
619 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
623 wxComboBox *file_combo;
624 wxCheckBox *dump_checkbox;
625 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
626 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
628 /* Controls for the SAP announces */
630 wxPanel *misc_subpanels[MISC_SOUT_NUM];
631 wxCheckBox *sap_checkbox;
632 wxCheckBox *slp_checkbox;
633 wxTextCtrl *announce_addr;
635 /* Controls for the encapsulation */
636 wxPanel *encapsulation_panel;
637 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
638 int i_encapsulation_type;
640 /* Controls for transcoding */
641 wxPanel *transcoding_panel;
642 wxCheckBox *video_transc_checkbox;
643 wxComboBox *video_codec_combo;
644 wxComboBox *audio_codec_combo;
645 wxCheckBox *audio_transc_checkbox;
646 wxComboBox *video_bitrate_combo;
647 wxComboBox *audio_bitrate_combo;
648 wxComboBox *audio_channels_combo;
649 wxComboBox *video_scale_combo;
652 /* Subtitles File Dialog */
653 class SubsFileDialog: public wxDialog
657 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
658 virtual ~SubsFileDialog();
660 wxComboBox *file_combo;
661 wxComboBox *encoding_combo;
662 wxSpinCtrl *delay_spinctrl;
663 wxSpinCtrl *fps_spinctrl;
666 /* Event handlers (these functions should _not_ be virtual) */
667 void OnOk( wxCommandEvent& event );
668 void OnCancel( wxCommandEvent& event );
669 void OnFileBrowse( wxCommandEvent& event );
671 DECLARE_EVENT_TABLE();
673 intf_thread_t *p_intf;
678 class StreamDialog: public wxFrame
682 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
683 virtual ~StreamDialog();
686 void OnClose( wxCommandEvent& event );
687 void OnOpen( wxCommandEvent& event );
688 void OnSout( wxCommandEvent& event );
689 void OnStart( wxCommandEvent& event );
691 DECLARE_EVENT_TABLE();
693 intf_thread_t *p_intf;
695 wxStaticText *step2_label;
696 wxStaticText *step3_label;
697 wxButton *sout_button;
698 wxButton *start_button;
700 wxArrayString sout_mrl;
701 OpenDialog *p_open_dialog;
702 SoutDialog *p_sout_dialog;
706 class WizardDialog : public wxWizard
710 WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent );
711 virtual ~WizardDialog();
712 void SetTranscode( char *vcodec, int vb, char *acodec,int ab);
713 void SetMrl( const char *mrl );
714 void SetStream( char *method, char *address );
715 void SetTranscodeOut( char *address );
716 void SetAction( int i_action );
718 void SetMux( char *mux );
724 char *vcodec,*acodec,*method,*address,*mrl,*mux;
725 DECLARE_EVENT_TABLE();
727 intf_thread_t *p_intf;
731 /* Preferences Dialog */
732 class PrefsDialog: public wxFrame
736 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
737 virtual ~PrefsDialog();
740 wxPanel *PrefsPanel( wxWindow* parent );
742 /* Event handlers (these functions should _not_ be virtual) */
743 void OnOk( wxCommandEvent& event );
744 void OnCancel( wxCommandEvent& event );
745 void OnSave( wxCommandEvent& event );
746 void OnResetAll( wxCommandEvent& event );
747 void OnAdvanced( wxCommandEvent& event );
749 DECLARE_EVENT_TABLE();
751 intf_thread_t *p_intf;
753 PrefsTreeCtrl *prefs_tree;
757 class Messages: public wxFrame
761 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
763 bool Show( bool show = TRUE );
767 /* Event handlers (these functions should _not_ be virtual) */
768 void OnClose( wxCommandEvent& event );
769 void OnClear( wxCommandEvent& event );
770 void OnSaveLog( wxCommandEvent& event );
772 DECLARE_EVENT_TABLE();
774 intf_thread_t *p_intf;
775 wxTextCtrl *textctrl;
776 wxTextAttr *info_attr;
777 wxTextAttr *err_attr;
778 wxTextAttr *warn_attr;
779 wxTextAttr *dbg_attr;
781 wxFileDialog *save_log_dialog;
783 vlc_bool_t b_verbose;
787 class Playlist: public wxFrame
791 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
794 void UpdatePlaylist();
795 void ShowPlaylist( bool show );
796 void UpdateItem( int );
801 void DeleteItem( int item );
802 void ShowInfos( int item );
804 /* Event handlers (these functions should _not_ be virtual) */
805 void OnAddFile( wxCommandEvent& event );
806 void OnAddMRL( wxCommandEvent& event );
807 void OnClose( wxCommandEvent& event );
808 void OnSearch( wxCommandEvent& event );
809 void OnEnDis( wxCommandEvent& event );
810 void OnInfos( wxCommandEvent& event );
811 void OnSearchTextChange( wxCommandEvent& event );
812 void OnOpen( wxCommandEvent& event );
813 void OnSave( wxCommandEvent& event );
815 void OnSort( wxCommandEvent& event );
816 void OnColSelect( wxListEvent& event );
818 void OnUp( wxCommandEvent& event);
819 void OnDown( wxCommandEvent& event);
821 void OnEnableSelection( wxCommandEvent& event );
822 void OnDisableSelection( wxCommandEvent& event );
823 void OnInvertSelection( wxCommandEvent& event );
824 void OnDeleteSelection( wxCommandEvent& event );
825 void OnSelectAll( wxCommandEvent& event );
826 void OnRandom( wxCommandEvent& event );
827 void OnRepeat( wxCommandEvent& event );
828 void OnLoop ( wxCommandEvent& event );
829 void OnActivateItem( wxListEvent& event );
830 void OnKeyDown( wxListEvent& event );
831 void OnNewGroup( wxCommandEvent& event );
833 /* Popup functions */
834 void OnPopup( wxListEvent& event );
835 void OnPopupPlay( wxMenuEvent& event );
836 void OnPopupDel( wxMenuEvent& event );
837 void OnPopupEna( wxMenuEvent& event );
838 void OnPopupInfo( wxMenuEvent& event );
842 void OnPlaylistEvent( wxCommandEvent& event );
844 wxTextCtrl *search_text;
845 wxButton *search_button;
846 DECLARE_EVENT_TABLE();
850 ItemInfoDialog *iteminfo_dialog;
852 intf_thread_t *p_intf;
853 wxListView *listview;
854 wxTreeCtrl *treeview;
855 int i_update_counter;
863 int i_duration_sorted;
866 class NewGroup: public wxDialog
870 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
875 /* Event handlers (these functions should _not_ be virtual) */
876 void OnOk( wxCommandEvent& event );
877 void OnCancel( wxCommandEvent& event );
879 DECLARE_EVENT_TABLE();
881 intf_thread_t *p_intf;
882 wxTextCtrl *groupname;
885 friend class Playlist;
886 friend class ItemInfoDialog;
890 /* ItemInfo Dialog */
891 class ItemInfoDialog: public wxDialog
895 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
896 wxWindow *p_parent );
897 virtual ~ItemInfoDialog();
899 wxArrayString GetOptions();
902 wxPanel *InfoPanel( wxWindow* parent );
903 wxPanel *GroupPanel( wxWindow* parent );
905 /* Event handlers (these functions should _not_ be virtual) */
906 void OnOk( wxCommandEvent& event );
907 void OnCancel( wxCommandEvent& event );
908 void OnNewGroup( wxCommandEvent& event );
912 DECLARE_EVENT_TABLE();
914 intf_thread_t *p_intf;
915 playlist_item_t *p_item;
918 /* Controls for the iteminfo dialog box */
919 wxPanel *info_subpanel;
922 wxPanel *group_subpanel;
923 wxPanel *group_panel;
925 wxTextCtrl *uri_text;
926 wxTextCtrl *name_text;
927 wxTextCtrl *author_text;
929 wxTreeCtrl *info_tree;
930 wxTreeItemId info_root;
932 wxCheckBox *enabled_checkbox;
933 wxComboBox *group_combo;
939 class FileInfo: public wxFrame
943 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
945 void UpdateFileInfo();
948 void OnClose( wxCommandEvent& event );
950 DECLARE_EVENT_TABLE();
952 intf_thread_t *p_intf;
953 wxTreeCtrl *fileinfo_tree;
954 wxTreeItemId fileinfo_root;
955 wxString fileinfo_root_label;
960 #if !defined(__WXX11__)
961 /* Drag and Drop class */
962 class DragAndDrop: public wxFileDropTarget
965 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
967 virtual bool OnDropFiles( wxCoord x, wxCoord y,
968 const wxArrayString& filenames );
971 intf_thread_t *p_intf;
972 vlc_bool_t b_enqueue;
975 } // end of wxvlc namespace
978 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
979 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
980 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
981 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
982 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
986 class MenuEvtHandler : public wxEvtHandler
989 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
990 virtual ~MenuEvtHandler();
992 void OnMenuEvent( wxCommandEvent& event );
993 void OnShowDialog( wxCommandEvent& event );
997 DECLARE_EVENT_TABLE()
999 intf_thread_t *p_intf;
1000 Interface *p_main_interface;
1003 } // end of wxvlc namespace
1004 using namespace wxvlc;
1006 static inline int ConvertHotkeyModifiers( int i_hotkey )
1008 int i_accel_flags = 0;
1009 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
1010 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
1011 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
1012 return i_accel_flags;
1015 static inline int ConvertHotkey( int i_hotkey )
1017 int i_key = i_hotkey & ~KEY_MODIFIER;
1018 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
1019 else if( i_key & KEY_SPECIAL )
1023 case KEY_LEFT: return WXK_LEFT;
1024 case KEY_RIGHT: return WXK_RIGHT;
1025 case KEY_UP: return WXK_UP;
1026 case KEY_DOWN: return WXK_DOWN;
1027 case KEY_SPACE: return WXK_SPACE;
1028 case KEY_ENTER: return WXK_RETURN;
1029 case KEY_F1: return WXK_F1;
1030 case KEY_F2: return WXK_F2;
1031 case KEY_F3: return WXK_F3;
1032 case KEY_F4: return WXK_F4;
1033 case KEY_F5: return WXK_F5;
1034 case KEY_F6: return WXK_F6;
1035 case KEY_F7: return WXK_F7;
1036 case KEY_F8: return WXK_F8;
1037 case KEY_F9: return WXK_F9;
1038 case KEY_F10: return WXK_F10;
1039 case KEY_F11: return WXK_F11;
1040 case KEY_F12: return WXK_F12;
1041 case KEY_HOME: return WXK_HOME;
1042 case KEY_END: return WXK_HOME;
1043 case KEY_MENU: return WXK_MENU;
1044 case KEY_ESC: return WXK_ESCAPE;
1045 case KEY_PAGEUP: return WXK_PRIOR;
1046 case KEY_PAGEDOWN: return WXK_NEXT;
1047 case KEY_TAB: return WXK_TAB;
1048 case KEY_BACKSPACE: return WXK_BACK;