]> git.sesse.net Git - vlc/blob - modules/gui/wxwindows/wxwindows.h
* modules/gui/wxwindows/*: some cleanup + disable seekbar if stream is not seekable.
[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 };
184
185 /* Main Interface */
186 class Interface: public wxFrame
187 {
188 public:
189     /* Constructor */
190     Interface( intf_thread_t *p_intf );
191     virtual ~Interface();
192     void TogglePlayButton( int i_playing_status );
193     void Update();
194
195     wxBoxSizer  *frame_sizer;
196     wxStatusBar *statusbar;
197
198     wxSlider    *slider;
199     wxWindow    *slider_frame;
200     wxWindow    *extra_frame;
201
202     vlc_bool_t b_extra;
203
204     wxStaticBox *adjust_box;
205     wxButton *restoredefaults_button;
206     wxSlider *brightness_slider;
207     wxSlider *contrast_slider;
208     wxSlider *saturation_slider;
209     wxSlider *hue_slider;
210     wxSlider *gamma_slider;
211
212     wxStaticBox *other_box;
213     wxComboBox *ratio_combo;
214
215     wxGauge     *volctrl;
216
217 private:
218     void SetupHotkeys();
219     void CreateOurMenuBar();
220     void CreateOurToolBar();
221     void CreateOurExtendedPanel();
222     void CreateOurSlider();
223     void Open( int i_access_method );
224
225     /* Event handlers (these functions should _not_ be virtual) */
226     void OnExit( wxCommandEvent& event );
227     void OnAbout( wxCommandEvent& event );
228
229     void OnOpenFileSimple( wxCommandEvent& event );
230     void OnOpenFile( wxCommandEvent& event );
231     void OnOpenDisc( wxCommandEvent& event );
232     void OnOpenNet( wxCommandEvent& event );
233     void OnOpenSat( wxCommandEvent& event );
234     void OnExtended( wxCommandEvent& event );
235     void OnBookmarks( wxCommandEvent& event );
236     void OnShowDialog( wxCommandEvent& event );
237     void OnPlayStream( wxCommandEvent& event );
238     void OnStopStream( wxCommandEvent& event );
239     void OnSliderUpdate( wxScrollEvent& event );
240     void OnPrevStream( wxCommandEvent& event );
241     void OnNextStream( wxCommandEvent& event );
242     void OnSlowStream( wxCommandEvent& event );
243     void OnFastStream( wxCommandEvent& event );
244
245     void OnEnableAdjust( wxCommandEvent& event );
246     void OnRestoreDefaults( wxCommandEvent& event);
247     void OnAdjustUpdate( wxScrollEvent& event );
248
249     void OnRatio( wxCommandEvent& event );
250     void OnEnableVisual( wxCommandEvent& event );
251
252     void OnMenuOpen( wxMenuEvent& event );
253
254 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
255     void OnContextMenu2(wxContextMenuEvent& event);
256 #endif
257     void OnContextMenu(wxMouseEvent& event);
258
259     void OnControlEvent( wxCommandEvent& event );
260
261     DECLARE_EVENT_TABLE();
262
263     Timer *timer;
264     intf_thread_t *p_intf;
265
266 private:
267     int i_old_playing_status;
268
269     /* For auto-generated menus */
270     wxMenu *p_settings_menu;
271     wxMenu *p_audio_menu;
272     wxMenu *p_video_menu;
273     wxMenu *p_navig_menu;
274 };
275
276 /* Open Dialog */
277 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
278 class OpenDialog: public wxDialog
279 {
280 public:
281     /* Constructor */
282     OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
283                 int i_access_method, int i_arg = 0  );
284
285     /* Extended Contructor */
286     OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
287                 int i_access_method, int i_arg = 0 , int _i_method = 0 );
288     virtual ~OpenDialog();
289
290     int Show();
291     int Show( int i_access_method, int i_arg = 0 );
292
293     void UpdateMRL();
294     void UpdateMRL( int i_access_method );
295
296     wxArrayString mrl;
297
298 private:
299     wxPanel *FilePanel( wxWindow* parent );
300     wxPanel *DiscPanel( wxWindow* parent );
301     wxPanel *NetPanel( wxWindow* parent );
302
303     ArrayOfAutoBuiltPanel input_tab_array;
304
305     /* Event handlers (these functions should _not_ be virtual) */
306     void OnOk( wxCommandEvent& event );
307     void OnCancel( wxCommandEvent& event );
308
309     void OnPageChange( wxNotebookEvent& event );
310     void OnMRLChange( wxCommandEvent& event );
311
312     /* Event handlers for the file page */
313     void OnFilePanelChange( wxCommandEvent& event );
314     void OnFileBrowse( wxCommandEvent& event );
315
316     /* Event handlers for the disc page */
317     void OnDiscPanelChange( wxCommandEvent& event );
318     void OnDiscTypeChange( wxCommandEvent& event );
319     void OnDiscDeviceChange( wxCommandEvent& event );
320
321     /* Event handlers for the net page */
322     void OnNetPanelChange( wxCommandEvent& event );
323     void OnNetTypeChange( wxCommandEvent& event );
324
325     /* Event handlers for the stream output */
326     void OnSubsFileEnable( wxCommandEvent& event );
327     void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
328
329     /* Event handlers for the stream output */
330     void OnSoutEnable( wxCommandEvent& event );
331     void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
332
333     DECLARE_EVENT_TABLE();
334
335     intf_thread_t *p_intf;
336     wxWindow *p_parent;
337     int i_current_access_method;
338     int i_disc_type_selection;
339
340     int i_method; /* Normal or for the stream dialog ? */
341     int i_open_arg;
342
343     wxComboBox *mrl_combo;
344     wxNotebook *notebook;
345
346     /* Controls for the file panel */
347     wxComboBox *file_combo;
348     wxFileDialog *file_dialog;
349
350     /* Controls for the disc panel */
351     wxRadioBox *disc_type;
352     wxTextCtrl *disc_device;
353     wxSpinCtrl *disc_title;
354     wxSpinCtrl *disc_chapter;
355
356     /* The media equivalent name for a DVD names. For example,
357        "Title", is "Track" for a CD-DA */
358     wxStaticText *disc_title_label;
359     wxStaticText *disc_chapter_label;
360     
361     /* Indicates if the disc device control was modified */
362     bool b_disc_device_changed;
363     
364     /* Controls for the net panel */
365     wxRadioBox *net_type;
366     int i_net_type;
367     wxPanel *net_subpanels[4];
368     wxRadioButton *net_radios[4];
369     wxSpinCtrl *net_ports[4];
370     int        i_net_ports[4];
371     wxTextCtrl *net_addrs[4];
372     wxCheckBox *net_ipv6;
373
374     /* Controls for the subtitles file */
375     wxButton *subsfile_button;
376     wxCheckBox *subsfile_checkbox;
377     SubsFileDialog *subsfile_dialog;
378     wxArrayString subsfile_mrl;
379
380     /* Controls for the stream output */
381     wxButton *sout_button;
382     wxCheckBox *sout_checkbox;
383     SoutDialog *sout_dialog;
384     wxArrayString sout_mrl;
385 };
386
387 enum
388 {
389     FILE_ACCESS = 0,
390     DISC_ACCESS,
391     NET_ACCESS,
392
393     /* Auto-built panels */
394     CAPTURE_ACCESS
395 };
396 #define MAX_ACCESS CAPTURE_ACCESS
397
398 /* Stream output Dialog */
399 enum
400 {
401     PLAY_ACCESS_OUT = 0,
402     FILE_ACCESS_OUT,
403     HTTP_ACCESS_OUT,
404     MMSH_ACCESS_OUT,
405     UDP_ACCESS_OUT,
406     RTP_ACCESS_OUT,
407     ACCESS_OUT_NUM
408 };
409
410 enum
411 {
412     TS_ENCAPSULATION = 0,
413     PS_ENCAPSULATION,
414     MPEG1_ENCAPSULATION,
415     OGG_ENCAPSULATION,
416     RAW_ENCAPSULATION,
417     ASF_ENCAPSULATION,
418     AVI_ENCAPSULATION,
419     MP4_ENCAPSULATION,
420     MOV_ENCAPSULATION,
421     ENCAPS_NUM
422 };
423
424 enum
425 {
426     ANN_MISC_SOUT = 0,
427     MISC_SOUT_NUM
428 };
429
430 class SoutDialog: public wxDialog
431 {
432 public:
433     /* Constructor */
434     SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
435     virtual ~SoutDialog();
436
437     wxArrayString GetOptions();
438
439 private:
440     void UpdateMRL();
441     wxPanel *AccessPanel( wxWindow* parent );
442     wxPanel *MiscPanel( wxWindow* parent );
443     wxPanel *EncapsulationPanel( wxWindow* parent );
444     wxPanel *TranscodingPanel( wxWindow* parent );
445     void    ParseMRL();
446
447     /* Event handlers (these functions should _not_ be virtual) */
448     void OnOk( wxCommandEvent& event );
449     void OnCancel( wxCommandEvent& event );
450     void OnMRLChange( wxCommandEvent& event );
451     void OnAccessTypeChange( wxCommandEvent& event );
452
453     /* Event handlers for the file access output */
454     void OnFileChange( wxCommandEvent& event );
455     void OnFileBrowse( wxCommandEvent& event );
456     void OnFileDump( wxCommandEvent& event );
457
458     /* Event handlers for the net access output */
459     void OnNetChange( wxCommandEvent& event );
460
461     /* Event specific to the announce address */
462     void OnAnnounceAddrChange( wxCommandEvent& event );
463
464     /* Event handlers for the encapsulation panel */
465     void OnEncapsulationChange( wxCommandEvent& event );
466
467     /* Event handlers for the transcoding panel */
468     void OnTranscodingEnable( wxCommandEvent& event );
469     void OnTranscodingChange( wxCommandEvent& event );
470
471     /* Event handlers for the misc panel */
472     void OnSAPMiscChange( wxCommandEvent& event );
473     void OnSLPMiscChange( wxCommandEvent& event );
474
475     DECLARE_EVENT_TABLE();
476
477     intf_thread_t *p_intf;
478     wxWindow *p_parent;
479
480     wxComboBox *mrl_combo;
481
482     /* Controls for the access outputs */
483     wxPanel *access_panel;
484     wxPanel *access_subpanels[ACCESS_OUT_NUM];
485     wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
486
487     int i_access_type;
488
489     wxComboBox *file_combo;
490     wxCheckBox *dump_checkbox;
491     wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
492     wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
493
494     /* Controls for the SAP announces */
495     wxPanel *misc_panel;
496     wxPanel *misc_subpanels[MISC_SOUT_NUM];
497     wxCheckBox *sap_checkbox;
498     wxCheckBox *slp_checkbox;
499     wxTextCtrl *announce_addr;
500
501     /* Controls for the encapsulation */
502     wxPanel *encapsulation_panel;
503     wxRadioButton *encapsulation_radios[ENCAPS_NUM];
504     int i_encapsulation_type;
505
506     /* Controls for transcoding */
507     wxPanel *transcoding_panel;
508     wxCheckBox *video_transc_checkbox;
509     wxComboBox *video_codec_combo;
510     wxComboBox *audio_codec_combo;
511     wxCheckBox *audio_transc_checkbox;
512     wxComboBox *video_bitrate_combo;
513     wxComboBox *audio_bitrate_combo;
514     wxComboBox *audio_channels_combo;
515     wxComboBox *video_scale_combo;
516 };
517
518 /* Subtitles File Dialog */
519 class SubsFileDialog: public wxDialog
520 {
521 public:
522     /* Constructor */
523     SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
524     virtual ~SubsFileDialog();
525
526     wxComboBox *file_combo;
527     wxComboBox *encoding_combo;
528     wxSpinCtrl *delay_spinctrl;
529     wxSpinCtrl *fps_spinctrl;
530
531 private:
532     /* Event handlers (these functions should _not_ be virtual) */
533     void OnOk( wxCommandEvent& event );
534     void OnCancel( wxCommandEvent& event );
535     void OnFileBrowse( wxCommandEvent& event );
536
537     DECLARE_EVENT_TABLE();
538
539     intf_thread_t *p_intf;
540     wxWindow *p_parent;
541 };
542
543 /* Stream */
544 class StreamDialog: public wxFrame
545 {
546 public:
547     /* Constructor */
548     StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
549     virtual ~StreamDialog();
550
551 private:
552     void OnClose( wxCommandEvent& event );
553     void OnOpen( wxCommandEvent& event );
554     void OnSout( wxCommandEvent& event );
555     void OnStart( wxCommandEvent& event );
556
557     DECLARE_EVENT_TABLE();
558
559     intf_thread_t *p_intf;
560
561     wxStaticText *step2_label;
562     wxStaticText *step3_label;
563     wxButton *sout_button;
564     wxButton *start_button;
565     wxArrayString mrl;
566     wxArrayString sout_mrl;
567     OpenDialog *p_open_dialog;
568     SoutDialog *p_sout_dialog;
569 };
570
571 /* Wizard */
572 class WizardDialog : public wxWizard
573 {
574 public:
575     /* Constructor */
576     WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent );
577     virtual ~WizardDialog();
578     void SetTranscode( char *vcodec, int vb, char *acodec,int ab);
579     void SetMrl( const char *mrl );
580     void SetPartial( int, int );
581     void SetStream( char *method, char *address );
582     void SetTranscodeOut( char *address );
583     void SetAction( int i_action );
584     int  GetAction();
585     void SetMux( char *mux );
586     void Run();
587     int i_action;
588
589 private:
590     int vb,ab;
591     int i_from, i_to;
592     char *vcodec,*acodec,*method,*address,*mrl,*mux;
593     DECLARE_EVENT_TABLE();
594
595     intf_thread_t *p_intf;
596 };
597
598
599 /* Preferences Dialog */
600 class PrefsDialog: public wxFrame
601 {
602 public:
603     /* Constructor */
604     PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
605     virtual ~PrefsDialog();
606
607 private:
608     wxPanel *PrefsPanel( wxWindow* parent );
609
610     /* Event handlers (these functions should _not_ be virtual) */
611     void OnOk( wxCommandEvent& event );
612     void OnCancel( wxCommandEvent& event );
613     void OnSave( wxCommandEvent& event );
614     void OnResetAll( wxCommandEvent& event );
615     void OnAdvanced( wxCommandEvent& event );
616
617     DECLARE_EVENT_TABLE();
618
619     intf_thread_t *p_intf;
620
621     PrefsTreeCtrl *prefs_tree;
622 };
623
624 /* Messages */
625 class Messages: public wxFrame
626 {
627 public:
628     /* Constructor */
629     Messages( intf_thread_t *p_intf, wxWindow *p_parent );
630     virtual ~Messages();
631     bool Show( bool show = TRUE );
632     void UpdateLog();
633
634 private:
635     /* Event handlers (these functions should _not_ be virtual) */
636     void OnClose( wxCommandEvent& event );
637     void OnClear( wxCommandEvent& event );
638     void OnSaveLog( wxCommandEvent& event );
639
640     DECLARE_EVENT_TABLE();
641
642     intf_thread_t *p_intf;
643     wxTextCtrl *textctrl;
644     wxTextAttr *info_attr;
645     wxTextAttr *err_attr;
646     wxTextAttr *warn_attr;
647     wxTextAttr *dbg_attr;
648
649     wxFileDialog *save_log_dialog;
650
651     vlc_bool_t b_verbose;
652 };
653
654 /* Playlist */
655 class Playlist: public wxFrame
656 {
657 public:
658     /* Constructor */
659     Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
660     virtual ~Playlist();
661
662     void UpdatePlaylist();
663     void ShowPlaylist( bool show );
664     void UpdateItem( int );
665
666     bool b_need_update;
667
668 private:
669     void DeleteItem( int item );
670     void ShowInfos( int item );
671
672     /* Event handlers (these functions should _not_ be virtual) */
673     void OnAddFile( wxCommandEvent& event );
674     void OnAddMRL( wxCommandEvent& event );
675     void OnClose( wxCommandEvent& event );
676     void OnSearch( wxCommandEvent& event );
677     void OnEnDis( wxCommandEvent& event );
678     void OnInfos( wxCommandEvent& event );
679     void OnSearchTextChange( wxCommandEvent& event );
680     void OnOpen( wxCommandEvent& event );
681     void OnSave( wxCommandEvent& event );
682
683     void OnSort( wxCommandEvent& event );
684     void OnColSelect( wxListEvent& event );
685
686     void OnUp( wxCommandEvent& event);
687     void OnDown( wxCommandEvent& event);
688
689     void OnEnableSelection( wxCommandEvent& event );
690     void OnDisableSelection( wxCommandEvent& event );
691     void OnInvertSelection( wxCommandEvent& event );
692     void OnDeleteSelection( wxCommandEvent& event );
693     void OnSelectAll( wxCommandEvent& event );
694     void OnRandom( wxCommandEvent& event );
695     void OnRepeat( wxCommandEvent& event );
696     void OnLoop ( wxCommandEvent& event );
697     void OnActivateItem( wxListEvent& event );
698     void OnKeyDown( wxListEvent& event );
699     void OnNewGroup( wxCommandEvent& event );
700
701     /* Popup functions */
702     void OnPopup( wxListEvent& event );
703     void OnPopupPlay( wxMenuEvent& event );
704     void OnPopupDel( wxMenuEvent& event );
705     void OnPopupEna( wxMenuEvent& event );
706     void OnPopupInfo( wxMenuEvent& event );
707     void Rebuild();
708
709     /* Custom events */
710     void OnPlaylistEvent( wxCommandEvent& event );
711
712     wxTextCtrl *search_text;
713     wxButton *search_button;
714     DECLARE_EVENT_TABLE();
715
716     wxMenu *popup_menu;
717
718     ItemInfoDialog *iteminfo_dialog;
719
720     intf_thread_t *p_intf;
721     wxListView *listview;
722     wxTreeCtrl *treeview;
723     int i_update_counter;
724     int i_sort_mode;
725
726     int i_popup_item;
727
728     int i_title_sorted;
729     int i_author_sorted;
730     int i_group_sorted;
731     int i_duration_sorted;
732 };
733
734 class NewGroup: public wxDialog
735 {
736 public:
737     /* Constructor */
738     NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
739     virtual ~NewGroup();
740
741 private:
742
743     /* Event handlers (these functions should _not_ be virtual) */
744     void OnOk( wxCommandEvent& event );
745     void OnCancel( wxCommandEvent& event );
746
747     DECLARE_EVENT_TABLE();
748
749     intf_thread_t *p_intf;
750     wxTextCtrl *groupname;
751
752 protected:
753     friend class Playlist;
754     friend class ItemInfoDialog;
755     char *psz_name;
756 };
757
758 /* ItemInfo Dialog */
759 class ItemInfoDialog: public wxDialog
760 {
761 public:
762     /* Constructor */
763     ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
764                     wxWindow *p_parent );
765     virtual ~ItemInfoDialog();
766
767     wxArrayString GetOptions();
768
769 private:
770     wxPanel *InfoPanel( wxWindow* parent );
771     wxPanel *GroupPanel( wxWindow* parent );
772
773     /* Event handlers (these functions should _not_ be virtual) */
774     void OnOk( wxCommandEvent& event );
775     void OnCancel( wxCommandEvent& event );
776     void OnNewGroup( wxCommandEvent& event );
777
778     void UpdateInfo();
779
780     DECLARE_EVENT_TABLE();
781
782     intf_thread_t *p_intf;
783     playlist_item_t *p_item;
784     wxWindow *p_parent;
785
786     /* Controls for the iteminfo dialog box */
787     wxPanel *info_subpanel;
788     wxPanel *info_panel;
789
790     wxPanel *group_subpanel;
791     wxPanel *group_panel;
792
793     wxTextCtrl *uri_text;
794     wxTextCtrl *name_text;
795     wxTextCtrl *author_text;
796
797     wxTreeCtrl *info_tree;
798     wxTreeItemId info_root;
799
800     wxCheckBox *enabled_checkbox;
801     wxComboBox *group_combo;
802     int ids_array[100];
803 };
804
805
806 /* File Info */
807 class FileInfo: public wxFrame
808 {
809 public:
810     /* Constructor */
811     FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
812     virtual ~FileInfo();
813     void UpdateFileInfo();
814
815 private:
816     void OnClose( wxCommandEvent& event );
817
818     DECLARE_EVENT_TABLE();
819
820     intf_thread_t *p_intf;
821     wxTreeCtrl *fileinfo_tree;
822     wxTreeItemId fileinfo_root;
823     wxString fileinfo_root_label;
824
825 };
826
827 #if wxUSE_DRAG_AND_DROP
828 /* Drag and Drop class */
829 class DragAndDrop: public wxFileDropTarget
830 {
831 public:
832     DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
833
834     virtual bool OnDropFiles( wxCoord x, wxCoord y,
835                               const wxArrayString& filenames );
836
837 private:
838     intf_thread_t *p_intf;
839     vlc_bool_t b_enqueue;
840 };
841 #endif
842 } // end of wxvlc namespace
843
844 /* Menus */
845 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
846 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
847 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
848 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
849 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
850
851 namespace wxvlc
852 {
853 class MenuEvtHandler : public wxEvtHandler
854 {
855 public:
856     MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
857     virtual ~MenuEvtHandler();
858
859     void OnMenuEvent( wxCommandEvent& event );
860     void OnShowDialog( wxCommandEvent& event );
861
862 private:
863
864     DECLARE_EVENT_TABLE()
865
866     intf_thread_t *p_intf;
867     Interface *p_main_interface;
868 };
869
870 } // end of wxvlc namespace
871 using namespace wxvlc;