]> git.sesse.net Git - vlc/blob - modules/gui/wxwindows/wxwindows.h
* modules/gui/wxwindows/menus.cpp: release the wxMutexGui lock before triggering...
[vlc] / modules / gui / wxwindows / wxwindows.h
1 /*****************************************************************************
2  * wxwindows.h: private wxWindows interface description
3  *****************************************************************************
4  * Copyright (C) 1999-2004 VideoLAN
5  * $Id$
6  *
7  * Authors: Gildas Bazin <gbazin@videolan.org>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 #ifdef WIN32                                                 /* mingw32 hack */
25 #undef Yield
26 #undef CreateDialog
27 #endif
28
29 /* Let vlc take care of the i18n stuff */
30 #define WXINTL_NO_GETTEXT_MACRO
31
32 #include <wx/wxprec.h>
33 #include <wx/wx.h>
34
35 #include <wx/listctrl.h>
36 #include <wx/textctrl.h>
37 #include <wx/notebook.h>
38 #include <wx/spinctrl.h>
39 #include <wx/dnd.h>
40 #include <wx/treectrl.h>
41 #include <wx/gauge.h>
42 #include <wx/accel.h>
43 #include <wx/checkbox.h>
44 #include <wx/wizard.h>
45 #include "vlc_keys.h"
46
47 /* Hmmm, work-around for newest wxWin */
48 #ifdef wxStaticCastEvent
49 #   undef wxStaticCastEvent
50 #   define wxStaticCastEvent(type, val) ((type)(val))
51 #endif
52
53 DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
54 DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
55
56 #define SLIDER_MAX_POS 10000
57
58 /* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
59 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
60 #if wxUSE_UNICODE
61 #   define wxU(utf8) wxString(utf8, wxConvUTF8)
62 #else
63 #   define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
64 #endif
65 #define ISUTF8 1
66
67 #else // ENABLE_NLS && ENABLE_UTF8
68 #if wxUSE_UNICODE
69 #   define wxU(ansi) wxString(ansi, *wxConvCurrent)
70 #else
71 #   define wxU(ansi) ansi
72 #endif
73 #define ISUTF8 0
74
75 #endif
76
77 /* wxL2U (locale to unicode) is used to convert ansi strings to unicode
78  * strings (wchar_t) */
79 #if wxUSE_UNICODE
80 #   define wxL2U(ansi) wxString(ansi, *wxConvCurrent)
81 #else
82 #   define wxL2U(ansi) ansi
83 #endif
84
85 #define WRAPCOUNT 80
86
87 #define OPEN_NORMAL 0
88 #define OPEN_STREAM 1
89
90 #define MODE_NONE 0
91 #define MODE_GROUP 1
92 #define MODE_AUTHOR 2
93 #define MODE_TITLE 3
94
95 class DialogsProvider;
96 class PrefsTreeCtrl;
97 class AutoBuiltPanel;
98 class VideoWindow;
99
100 /*****************************************************************************
101  * intf_sys_t: description and status of wxwindows interface
102  *****************************************************************************/
103 struct intf_sys_t
104 {
105     /* the wx parent window */
106     wxWindow            *p_wxwindow;
107     wxIcon              *p_icon;
108
109     /* special actions */
110     vlc_bool_t          b_playing;
111
112     /* The input thread */
113     input_thread_t *    p_input;
114
115     /* The slider */
116     int                 i_slider_pos;                     /* slider position */
117     int                 i_slider_oldpos;                /* previous position */
118     vlc_bool_t          b_slider_free;                      /* slider status */
119
120     /* The messages window */
121     msg_subscription_t* p_sub;                  /* message bank subscription */
122
123     /* Playlist management */
124     int                 i_playing;                 /* playlist selected item */
125
126     /* Send an event to show a dialog */
127     void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
128                              intf_dialog_args_t *p_arg );
129
130     /* Popup menu */
131     wxMenu              *p_popup_menu;
132
133     /* Hotkeys */
134     int                 i_first_hotkey_event;
135     int                 i_hotkeys;
136
137     /* Embedded vout */
138     VideoWindow         *p_video_window;
139     wxBoxSizer          *p_video_sizer;
140 };
141
142 /*****************************************************************************
143  * Prototypes
144  *****************************************************************************/
145 wxArrayString SeparateEntries( wxString );
146 wxWindow *VideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
147 wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
148 wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
149
150 namespace wxvlc
151 {
152 class Interface;
153 class OpenDialog;
154 class SoutDialog;
155 class SubsFileDialog;
156 class Playlist;
157 class Messages;
158 class FileInfo;
159 class StreamDialog;
160 class WizardDialog;
161 class ItemInfoDialog;
162 class NewGroup;
163 class ExportPlaylist;
164
165 /*****************************************************************************
166  * Classes declarations.
167  *****************************************************************************/
168 /* Timer */
169 class Timer: public wxTimer
170 {
171 public:
172     /* Constructor */
173     Timer( intf_thread_t *p_intf, Interface *p_main_interface );
174     virtual ~Timer();
175
176     virtual void Notify();
177
178 private:
179     intf_thread_t *p_intf;
180     Interface *p_main_interface;
181     int i_old_playing_status;
182     int i_old_rate;
183     vlc_bool_t b_old_seekable;
184 };
185
186 /* Main Interface */
187 class Interface: public wxFrame
188 {
189 public:
190     /* Constructor */
191     Interface( intf_thread_t *p_intf );
192     virtual ~Interface();
193     void TogglePlayButton( int i_playing_status );
194     void Update();
195
196     wxBoxSizer  *frame_sizer;
197     wxStatusBar *statusbar;
198
199     wxSlider    *slider;
200     wxWindow    *slider_frame;
201     wxWindow    *extra_frame;
202
203     vlc_bool_t b_extra;
204
205     wxStaticBox *adjust_box;
206     wxButton *restoredefaults_button;
207     wxSlider *brightness_slider;
208     wxSlider *contrast_slider;
209     wxSlider *saturation_slider;
210     wxSlider *hue_slider;
211     wxSlider *gamma_slider;
212
213     wxStaticBox *other_box;
214     wxComboBox *ratio_combo;
215
216     wxGauge     *volctrl;
217
218 private:
219     void SetupHotkeys();
220     void CreateOurMenuBar();
221     void CreateOurToolBar();
222     void CreateOurExtendedPanel();
223     void CreateOurSlider();
224     void Open( int i_access_method );
225
226     /* Event handlers (these functions should _not_ be virtual) */
227     void OnExit( wxCommandEvent& event );
228     void OnAbout( wxCommandEvent& event );
229
230     void OnOpenFileSimple( wxCommandEvent& event );
231     void OnOpenFile( wxCommandEvent& event );
232     void OnOpenDisc( wxCommandEvent& event );
233     void OnOpenNet( wxCommandEvent& event );
234     void OnOpenSat( wxCommandEvent& event );
235     void OnExtended( wxCommandEvent& event );
236     void OnBookmarks( wxCommandEvent& event );
237     void OnShowDialog( wxCommandEvent& event );
238     void OnPlayStream( wxCommandEvent& event );
239     void OnStopStream( wxCommandEvent& event );
240     void OnSliderUpdate( wxScrollEvent& event );
241     void OnPrevStream( wxCommandEvent& event );
242     void OnNextStream( wxCommandEvent& event );
243     void OnSlowStream( wxCommandEvent& event );
244     void OnFastStream( wxCommandEvent& event );
245
246     void OnEnableAdjust( wxCommandEvent& event );
247     void OnRestoreDefaults( wxCommandEvent& event);
248     void OnAdjustUpdate( wxScrollEvent& event );
249
250     void OnRatio( wxCommandEvent& event );
251     void OnEnableVisual( wxCommandEvent& event );
252
253     void OnMenuOpen( wxMenuEvent& event );
254
255 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
256     void OnContextMenu2(wxContextMenuEvent& event);
257 #endif
258     void OnContextMenu(wxMouseEvent& event);
259
260     void OnControlEvent( wxCommandEvent& event );
261
262     DECLARE_EVENT_TABLE();
263
264     Timer *timer;
265     intf_thread_t *p_intf;
266
267 private:
268     int i_old_playing_status;
269
270     /* For auto-generated menus */
271     wxMenu *p_settings_menu;
272     wxMenu *p_audio_menu;
273     wxMenu *p_video_menu;
274     wxMenu *p_navig_menu;
275 };
276
277 /* Open Dialog */
278 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
279 class OpenDialog: public wxDialog
280 {
281 public:
282     /* Constructor */
283     OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
284                 int i_access_method, int i_arg = 0  );
285
286     /* Extended Contructor */
287     OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
288                 int i_access_method, int i_arg = 0 , int _i_method = 0 );
289     virtual ~OpenDialog();
290
291     int Show();
292     int Show( int i_access_method, int i_arg = 0 );
293
294     void UpdateMRL();
295     void UpdateMRL( int i_access_method );
296
297     wxArrayString mrl;
298
299 private:
300     wxPanel *FilePanel( wxWindow* parent );
301     wxPanel *DiscPanel( wxWindow* parent );
302     wxPanel *NetPanel( wxWindow* parent );
303
304     ArrayOfAutoBuiltPanel input_tab_array;
305
306     /* Event handlers (these functions should _not_ be virtual) */
307     void OnOk( wxCommandEvent& event );
308     void OnCancel( wxCommandEvent& event );
309
310     void OnPageChange( wxNotebookEvent& event );
311     void OnMRLChange( wxCommandEvent& event );
312
313     /* Event handlers for the file page */
314     void OnFilePanelChange( wxCommandEvent& event );
315     void OnFileBrowse( wxCommandEvent& event );
316
317     /* Event handlers for the disc page */
318     void OnDiscPanelChange( wxCommandEvent& event );
319     void OnDiscTypeChange( wxCommandEvent& event );
320     void OnDiscDeviceChange( wxCommandEvent& event );
321
322     /* Event handlers for the net page */
323     void OnNetPanelChange( wxCommandEvent& event );
324     void OnNetTypeChange( wxCommandEvent& event );
325
326     /* Event handlers for the stream output */
327     void OnSubsFileEnable( wxCommandEvent& event );
328     void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
329
330     /* Event handlers for the stream output */
331     void OnSoutEnable( wxCommandEvent& event );
332     void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
333
334     DECLARE_EVENT_TABLE();
335
336     intf_thread_t *p_intf;
337     wxWindow *p_parent;
338     int i_current_access_method;
339     int i_disc_type_selection;
340
341     int i_method; /* Normal or for the stream dialog ? */
342     int i_open_arg;
343
344     wxComboBox *mrl_combo;
345     wxNotebook *notebook;
346
347     /* Controls for the file panel */
348     wxComboBox *file_combo;
349     wxFileDialog *file_dialog;
350
351     /* Controls for the disc panel */
352     wxRadioBox *disc_type;
353     wxTextCtrl *disc_device;
354     wxSpinCtrl *disc_title;
355     wxSpinCtrl *disc_chapter;
356
357     /* The media equivalent name for a DVD names. For example,
358        "Title", is "Track" for a CD-DA */
359     wxStaticText *disc_title_label;
360     wxStaticText *disc_chapter_label;
361     
362     /* Indicates if the disc device control was modified */
363     bool b_disc_device_changed;
364     
365     /* Controls for the net panel */
366     wxRadioBox *net_type;
367     int i_net_type;
368     wxPanel *net_subpanels[4];
369     wxRadioButton *net_radios[4];
370     wxSpinCtrl *net_ports[4];
371     int        i_net_ports[4];
372     wxTextCtrl *net_addrs[4];
373     wxCheckBox *net_ipv6;
374
375     /* Controls for the subtitles file */
376     wxButton *subsfile_button;
377     wxCheckBox *subsfile_checkbox;
378     SubsFileDialog *subsfile_dialog;
379     wxArrayString subsfile_mrl;
380
381     /* Controls for the stream output */
382     wxButton *sout_button;
383     wxCheckBox *sout_checkbox;
384     SoutDialog *sout_dialog;
385     wxArrayString sout_mrl;
386 };
387
388 enum
389 {
390     FILE_ACCESS = 0,
391     DISC_ACCESS,
392     NET_ACCESS,
393
394     /* Auto-built panels */
395     CAPTURE_ACCESS
396 };
397 #define MAX_ACCESS CAPTURE_ACCESS
398
399 /* Stream output Dialog */
400 enum
401 {
402     PLAY_ACCESS_OUT = 0,
403     FILE_ACCESS_OUT,
404     HTTP_ACCESS_OUT,
405     MMSH_ACCESS_OUT,
406     UDP_ACCESS_OUT,
407     RTP_ACCESS_OUT,
408     ACCESS_OUT_NUM
409 };
410
411 enum
412 {
413     TS_ENCAPSULATION = 0,
414     PS_ENCAPSULATION,
415     MPEG1_ENCAPSULATION,
416     OGG_ENCAPSULATION,
417     RAW_ENCAPSULATION,
418     ASF_ENCAPSULATION,
419     AVI_ENCAPSULATION,
420     MP4_ENCAPSULATION,
421     MOV_ENCAPSULATION,
422     ENCAPS_NUM
423 };
424
425 enum
426 {
427     ANN_MISC_SOUT = 0,
428     MISC_SOUT_NUM
429 };
430
431 class SoutDialog: public wxDialog
432 {
433 public:
434     /* Constructor */
435     SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
436     virtual ~SoutDialog();
437
438     wxArrayString GetOptions();
439
440 private:
441     void UpdateMRL();
442     wxPanel *AccessPanel( wxWindow* parent );
443     wxPanel *MiscPanel( wxWindow* parent );
444     wxPanel *EncapsulationPanel( wxWindow* parent );
445     wxPanel *TranscodingPanel( wxWindow* parent );
446     void    ParseMRL();
447
448     /* Event handlers (these functions should _not_ be virtual) */
449     void OnOk( wxCommandEvent& event );
450     void OnCancel( wxCommandEvent& event );
451     void OnMRLChange( wxCommandEvent& event );
452     void OnAccessTypeChange( wxCommandEvent& event );
453
454     /* Event handlers for the file access output */
455     void OnFileChange( wxCommandEvent& event );
456     void OnFileBrowse( wxCommandEvent& event );
457     void OnFileDump( wxCommandEvent& event );
458
459     /* Event handlers for the net access output */
460     void OnNetChange( wxCommandEvent& event );
461
462     /* Event specific to the announce address */
463     void OnAnnounceAddrChange( wxCommandEvent& event );
464
465     /* Event handlers for the encapsulation panel */
466     void OnEncapsulationChange( wxCommandEvent& event );
467
468     /* Event handlers for the transcoding panel */
469     void OnTranscodingEnable( wxCommandEvent& event );
470     void OnTranscodingChange( wxCommandEvent& event );
471
472     /* Event handlers for the misc panel */
473     void OnSAPMiscChange( wxCommandEvent& event );
474     void OnSLPMiscChange( wxCommandEvent& event );
475
476     DECLARE_EVENT_TABLE();
477
478     intf_thread_t *p_intf;
479     wxWindow *p_parent;
480
481     wxComboBox *mrl_combo;
482
483     /* Controls for the access outputs */
484     wxPanel *access_panel;
485     wxPanel *access_subpanels[ACCESS_OUT_NUM];
486     wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
487
488     int i_access_type;
489
490     wxComboBox *file_combo;
491     wxCheckBox *dump_checkbox;
492     wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
493     wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
494
495     /* Controls for the SAP announces */
496     wxPanel *misc_panel;
497     wxPanel *misc_subpanels[MISC_SOUT_NUM];
498     wxCheckBox *sap_checkbox;
499     wxCheckBox *slp_checkbox;
500     wxTextCtrl *announce_addr;
501
502     /* Controls for the encapsulation */
503     wxPanel *encapsulation_panel;
504     wxRadioButton *encapsulation_radios[ENCAPS_NUM];
505     int i_encapsulation_type;
506
507     /* Controls for transcoding */
508     wxPanel *transcoding_panel;
509     wxCheckBox *video_transc_checkbox;
510     wxComboBox *video_codec_combo;
511     wxComboBox *audio_codec_combo;
512     wxCheckBox *audio_transc_checkbox;
513     wxComboBox *video_bitrate_combo;
514     wxComboBox *audio_bitrate_combo;
515     wxComboBox *audio_channels_combo;
516     wxComboBox *video_scale_combo;
517 };
518
519 /* Subtitles File Dialog */
520 class SubsFileDialog: public wxDialog
521 {
522 public:
523     /* Constructor */
524     SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
525     virtual ~SubsFileDialog();
526
527     wxComboBox *file_combo;
528     wxComboBox *encoding_combo;
529     wxSpinCtrl *delay_spinctrl;
530     wxSpinCtrl *fps_spinctrl;
531
532 private:
533     /* Event handlers (these functions should _not_ be virtual) */
534     void OnOk( wxCommandEvent& event );
535     void OnCancel( wxCommandEvent& event );
536     void OnFileBrowse( wxCommandEvent& event );
537
538     DECLARE_EVENT_TABLE();
539
540     intf_thread_t *p_intf;
541     wxWindow *p_parent;
542 };
543
544 /* Stream */
545 class StreamDialog: public wxFrame
546 {
547 public:
548     /* Constructor */
549     StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
550     virtual ~StreamDialog();
551
552 private:
553     void OnClose( wxCommandEvent& event );
554     void OnOpen( wxCommandEvent& event );
555     void OnSout( wxCommandEvent& event );
556     void OnStart( wxCommandEvent& event );
557
558     DECLARE_EVENT_TABLE();
559
560     intf_thread_t *p_intf;
561
562     wxStaticText *step2_label;
563     wxStaticText *step3_label;
564     wxButton *sout_button;
565     wxButton *start_button;
566     wxArrayString mrl;
567     wxArrayString sout_mrl;
568     OpenDialog *p_open_dialog;
569     SoutDialog *p_sout_dialog;
570 };
571
572 /* Wizard */
573 class WizardDialog : public wxWizard
574 {
575 public:
576     /* Constructor */
577     WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent );
578     virtual ~WizardDialog();
579     void SetTranscode( char *vcodec, int vb, char *acodec,int ab);
580     void SetMrl( const char *mrl );
581     void SetPartial( int, int );
582     void SetStream( char *method, char *address );
583     void SetTranscodeOut( char *address );
584     void SetAction( int i_action );
585     int  GetAction();
586     void SetMux( char *mux );
587     void Run();
588     int i_action;
589
590 private:
591     int vb,ab;
592     int i_from, i_to;
593     char *vcodec,*acodec,*method,*address,*mrl,*mux;
594     DECLARE_EVENT_TABLE();
595
596     intf_thread_t *p_intf;
597 };
598
599
600 /* Preferences Dialog */
601 class PrefsDialog: public wxFrame
602 {
603 public:
604     /* Constructor */
605     PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
606     virtual ~PrefsDialog();
607
608 private:
609     wxPanel *PrefsPanel( wxWindow* parent );
610
611     /* Event handlers (these functions should _not_ be virtual) */
612     void OnOk( wxCommandEvent& event );
613     void OnCancel( wxCommandEvent& event );
614     void OnSave( wxCommandEvent& event );
615     void OnResetAll( wxCommandEvent& event );
616     void OnAdvanced( wxCommandEvent& event );
617
618     DECLARE_EVENT_TABLE();
619
620     intf_thread_t *p_intf;
621
622     PrefsTreeCtrl *prefs_tree;
623 };
624
625 /* Messages */
626 class Messages: public wxFrame
627 {
628 public:
629     /* Constructor */
630     Messages( intf_thread_t *p_intf, wxWindow *p_parent );
631     virtual ~Messages();
632     bool Show( bool show = TRUE );
633     void UpdateLog();
634
635 private:
636     /* Event handlers (these functions should _not_ be virtual) */
637     void OnClose( wxCommandEvent& event );
638     void OnClear( wxCommandEvent& event );
639     void OnSaveLog( wxCommandEvent& event );
640
641     DECLARE_EVENT_TABLE();
642
643     intf_thread_t *p_intf;
644     wxTextCtrl *textctrl;
645     wxTextAttr *info_attr;
646     wxTextAttr *err_attr;
647     wxTextAttr *warn_attr;
648     wxTextAttr *dbg_attr;
649
650     wxFileDialog *save_log_dialog;
651
652     vlc_bool_t b_verbose;
653 };
654
655 /* Playlist */
656 class Playlist: public wxFrame
657 {
658 public:
659     /* Constructor */
660     Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
661     virtual ~Playlist();
662
663     void UpdatePlaylist();
664     void ShowPlaylist( bool show );
665     void UpdateItem( int );
666
667     bool b_need_update;
668
669 private:
670     void DeleteItem( int item );
671     void ShowInfos( int item );
672
673     /* Event handlers (these functions should _not_ be virtual) */
674     void OnAddFile( wxCommandEvent& event );
675     void OnAddMRL( wxCommandEvent& event );
676     void OnClose( wxCommandEvent& event );
677     void OnSearch( wxCommandEvent& event );
678     void OnEnDis( wxCommandEvent& event );
679     void OnInfos( wxCommandEvent& event );
680     void OnSearchTextChange( wxCommandEvent& event );
681     void OnOpen( wxCommandEvent& event );
682     void OnSave( wxCommandEvent& event );
683
684     void OnSort( wxCommandEvent& event );
685     void OnColSelect( wxListEvent& event );
686
687     void OnUp( wxCommandEvent& event);
688     void OnDown( wxCommandEvent& event);
689
690     void OnEnableSelection( wxCommandEvent& event );
691     void OnDisableSelection( wxCommandEvent& event );
692     void OnInvertSelection( wxCommandEvent& event );
693     void OnDeleteSelection( wxCommandEvent& event );
694     void OnSelectAll( wxCommandEvent& event );
695     void OnRandom( wxCommandEvent& event );
696     void OnRepeat( wxCommandEvent& event );
697     void OnLoop ( wxCommandEvent& event );
698     void OnActivateItem( wxListEvent& event );
699     void OnKeyDown( wxListEvent& event );
700     void OnNewGroup( wxCommandEvent& event );
701
702     /* Popup functions */
703     void OnPopup( wxListEvent& event );
704     void OnPopupPlay( wxMenuEvent& event );
705     void OnPopupDel( wxMenuEvent& event );
706     void OnPopupEna( wxMenuEvent& event );
707     void OnPopupInfo( wxMenuEvent& event );
708     void Rebuild();
709
710     /* Custom events */
711     void OnPlaylistEvent( wxCommandEvent& event );
712
713     wxTextCtrl *search_text;
714     wxButton *search_button;
715     DECLARE_EVENT_TABLE();
716
717     wxMenu *popup_menu;
718
719     ItemInfoDialog *iteminfo_dialog;
720
721     intf_thread_t *p_intf;
722     wxListView *listview;
723     wxTreeCtrl *treeview;
724     int i_update_counter;
725     int i_sort_mode;
726
727     int i_popup_item;
728
729     int i_title_sorted;
730     int i_author_sorted;
731     int i_group_sorted;
732     int i_duration_sorted;
733 };
734
735 class NewGroup: public wxDialog
736 {
737 public:
738     /* Constructor */
739     NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
740     virtual ~NewGroup();
741
742 private:
743
744     /* Event handlers (these functions should _not_ be virtual) */
745     void OnOk( wxCommandEvent& event );
746     void OnCancel( wxCommandEvent& event );
747
748     DECLARE_EVENT_TABLE();
749
750     intf_thread_t *p_intf;
751     wxTextCtrl *groupname;
752
753 protected:
754     friend class Playlist;
755     friend class ItemInfoDialog;
756     char *psz_name;
757 };
758
759 /* ItemInfo Dialog */
760 class ItemInfoDialog: public wxDialog
761 {
762 public:
763     /* Constructor */
764     ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
765                     wxWindow *p_parent );
766     virtual ~ItemInfoDialog();
767
768     wxArrayString GetOptions();
769
770 private:
771     wxPanel *InfoPanel( wxWindow* parent );
772     wxPanel *GroupPanel( wxWindow* parent );
773
774     /* Event handlers (these functions should _not_ be virtual) */
775     void OnOk( wxCommandEvent& event );
776     void OnCancel( wxCommandEvent& event );
777     void OnNewGroup( wxCommandEvent& event );
778
779     void UpdateInfo();
780
781     DECLARE_EVENT_TABLE();
782
783     intf_thread_t *p_intf;
784     playlist_item_t *p_item;
785     wxWindow *p_parent;
786
787     /* Controls for the iteminfo dialog box */
788     wxPanel *info_subpanel;
789     wxPanel *info_panel;
790
791     wxPanel *group_subpanel;
792     wxPanel *group_panel;
793
794     wxTextCtrl *uri_text;
795     wxTextCtrl *name_text;
796     wxTextCtrl *author_text;
797
798     wxTreeCtrl *info_tree;
799     wxTreeItemId info_root;
800
801     wxCheckBox *enabled_checkbox;
802     wxComboBox *group_combo;
803     int ids_array[100];
804 };
805
806
807 /* File Info */
808 class FileInfo: public wxFrame
809 {
810 public:
811     /* Constructor */
812     FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
813     virtual ~FileInfo();
814     void UpdateFileInfo();
815
816 private:
817     void OnClose( wxCommandEvent& event );
818
819     DECLARE_EVENT_TABLE();
820
821     intf_thread_t *p_intf;
822     wxTreeCtrl *fileinfo_tree;
823     wxTreeItemId fileinfo_root;
824     wxString fileinfo_root_label;
825
826 };
827
828 #if wxUSE_DRAG_AND_DROP
829 /* Drag and Drop class */
830 class DragAndDrop: public wxFileDropTarget
831 {
832 public:
833     DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
834
835     virtual bool OnDropFiles( wxCoord x, wxCoord y,
836                               const wxArrayString& filenames );
837
838 private:
839     intf_thread_t *p_intf;
840     vlc_bool_t b_enqueue;
841 };
842 #endif
843 } // end of wxvlc namespace
844
845 /* Menus */
846 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
847 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
848 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
849 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
850 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
851
852 namespace wxvlc
853 {
854 class MenuEvtHandler : public wxEvtHandler
855 {
856 public:
857     MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
858     virtual ~MenuEvtHandler();
859
860     void OnMenuEvent( wxCommandEvent& event );
861     void OnShowDialog( wxCommandEvent& event );
862
863 private:
864
865     DECLARE_EVENT_TABLE()
866
867     intf_thread_t *p_intf;
868     Interface *p_main_interface;
869 };
870
871 } // end of wxvlc namespace
872 using namespace wxvlc;