]> git.sesse.net Git - vlc/blob - modules/gui/wxwindows/wxwindows.h
- modules/control/showintf.c: new control module, able to show the
[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     vlc_bool_t          b_intf_show;                /* interface to be shown */
112
113     /* The input thread */
114     input_thread_t *    p_input;
115
116     /* The slider */
117     int                 i_slider_pos;                     /* slider position */
118     int                 i_slider_oldpos;                /* previous position */
119     vlc_bool_t          b_slider_free;                      /* slider status */
120
121     /* The messages window */
122     msg_subscription_t* p_sub;                  /* message bank subscription */
123
124     /* Playlist management */
125     int                 i_playing;                 /* playlist selected item */
126
127     /* Send an event to show a dialog */
128     void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
129                              intf_dialog_args_t *p_arg );
130
131     /* Popup menu */
132     wxMenu              *p_popup_menu;
133
134     /* Hotkeys */
135     int                 i_first_hotkey_event;
136     int                 i_hotkeys;
137
138     /* Embedded vout */
139     VideoWindow         *p_video_window;
140     wxBoxSizer          *p_video_sizer;
141
142     /* Aout */
143     aout_instance_t     *p_aout;
144 };
145
146 /*****************************************************************************
147  * Prototypes
148  *****************************************************************************/
149 wxArrayString SeparateEntries( wxString );
150 wxWindow *VideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
151 wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
152 wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
153
154 namespace wxvlc
155 {
156 class Interface;
157 class OpenDialog;
158 class SoutDialog;
159 class SubsFileDialog;
160 class Playlist;
161 class Messages;
162 class FileInfo;
163 class StreamDialog;
164 class WizardDialog;
165 class ItemInfoDialog;
166 class NewGroup;
167 class ExportPlaylist;
168
169 /*****************************************************************************
170  * Classes declarations.
171  *****************************************************************************/
172 /* Timer */
173 class Timer: public wxTimer
174 {
175 public:
176     /* Constructor */
177     Timer( intf_thread_t *p_intf, Interface *p_main_interface );
178     virtual ~Timer();
179
180     virtual void Notify();
181
182 private:
183     intf_thread_t *p_intf;
184     Interface *p_main_interface;
185     vlc_bool_t b_init;
186     int i_old_playing_status;
187     int i_old_rate;
188     vlc_bool_t b_old_seekable;
189 };
190
191
192 /* Extended panel */
193 class ExtraPanel: public wxPanel
194 {
195 public:
196     /* Constructor */
197     ExtraPanel( intf_thread_t *p_intf, wxWindow *p_parent );
198     virtual ~ExtraPanel();
199
200     wxStaticBox *adjust_box;
201     wxButton *restoredefaults_button;
202     wxSlider *brightness_slider;
203     wxSlider *contrast_slider;
204     wxSlider *saturation_slider;
205     wxSlider *hue_slider;
206     wxSlider *gamma_slider;
207
208     wxStaticBox *other_box;
209     wxComboBox *ratio_combo;
210
211     char *psz_bands;
212     float f_preamp;
213     vlc_bool_t b_update;
214
215 private:
216
217     wxPanel *VideoPanel( wxWindow * );
218     wxPanel *EqzPanel( wxWindow * );
219     wxPanel *AudioPanel( wxWindow * );
220
221     wxNotebook *notebook;
222
223     wxCheckBox *eq_chkbox;
224
225     wxCheckBox *eq_2p_chkbox;
226
227     wxSlider *smooth_slider;
228
229     wxSlider *preamp_slider;
230     wxStaticText * preamp_text;
231
232     int i_smooth;
233     wxWindow *p_parent;
234
235     wxSlider *band_sliders[10];
236     wxStaticText *band_texts[10];
237
238     int i_values[10];
239
240     void CheckAout();
241
242     /* Event handlers (these functions should _not_ be virtual) */
243
244     void OnEnableAdjust( wxCommandEvent& );
245     void OnEnableEqualizer( wxCommandEvent& );
246     void OnRestoreDefaults( wxCommandEvent& );
247     void OnChangeEqualizer( wxScrollEvent& );
248     void OnAdjustUpdate( wxScrollEvent& );
249     void OnRatio( wxCommandEvent& );
250     void OnFiltersInfo( wxCommandEvent& );
251     void OnSelectFilter( wxCommandEvent& );
252
253     void OnEqSmooth( wxScrollEvent& );
254     void OnPreamp( wxScrollEvent& );
255     void OnEq2Pass( wxCommandEvent& );
256     void OnEqRestore( wxCommandEvent& );
257
258     void OnHeadphone( wxCommandEvent& );
259     void OnNormvol( wxCommandEvent& );
260     void OnNormvolSlider( wxScrollEvent& );
261
262     void OnIdle( wxIdleEvent& );
263
264     DECLARE_EVENT_TABLE();
265
266     intf_thread_t *p_intf;
267     vlc_bool_t b_my_update;
268 };
269
270 #if 0
271 /* Extended Window  */
272 class ExtraWindow: public wxFrame
273 {
274 public:
275     /* Constructor */
276     ExtraWindow( intf_thread_t *p_intf, wxWindow *p_parent, wxPanel *panel );
277     virtual ~ExtraWindow();
278
279 private:
280
281     wxPanel *panel;
282
283     DECLARE_EVENT_TABLE();
284
285     intf_thread_t *p_intf;
286 };
287 #endif
288
289 /* Main Interface */
290 class Interface: public wxFrame
291 {
292 public:
293     /* Constructor */
294     Interface( intf_thread_t *p_intf );
295     virtual ~Interface();
296     void Init();
297     void TogglePlayButton( int i_playing_status );
298     void Update();
299
300     wxBoxSizer  *frame_sizer;
301     wxStatusBar *statusbar;
302
303     wxSlider    *slider;
304     wxWindow    *slider_frame;
305     wxPanel     *extra_frame;
306
307     wxFrame    *extra_window;
308
309     vlc_bool_t b_extra;
310     vlc_bool_t b_undock;
311
312
313     wxGauge     *volctrl;
314
315 private:
316     void SetupHotkeys();
317     void CreateOurMenuBar();
318     void CreateOurToolBar();
319     void CreateOurExtendedPanel();
320     void CreateOurSlider();
321     void Open( int i_access_method );
322
323     /* Event handlers (these functions should _not_ be virtual) */
324     void OnExit( wxCommandEvent& event );
325     void OnAbout( wxCommandEvent& event );
326
327     void OnOpenFileSimple( wxCommandEvent& event );
328     void OnOpenFile( wxCommandEvent& event );
329     void OnOpenDisc( wxCommandEvent& event );
330     void OnOpenNet( wxCommandEvent& event );
331     void OnOpenSat( wxCommandEvent& event );
332
333     void OnExtended( wxCommandEvent& event );
334     //void OnUndock( wxCommandEvent& event );
335
336     void OnBookmarks( wxCommandEvent& event );
337     void OnShowDialog( wxCommandEvent& event );
338     void OnPlayStream( wxCommandEvent& event );
339     void OnStopStream( wxCommandEvent& event );
340     void OnSliderUpdate( wxScrollEvent& event );
341     void OnPrevStream( wxCommandEvent& event );
342     void OnNextStream( wxCommandEvent& event );
343     void OnSlowStream( wxCommandEvent& event );
344     void OnFastStream( wxCommandEvent& event );
345
346     void OnMenuOpen( wxMenuEvent& event );
347
348 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
349     void OnContextMenu2(wxContextMenuEvent& event);
350 #endif
351     void OnContextMenu(wxMouseEvent& event);
352
353     void OnControlEvent( wxCommandEvent& event );
354
355     DECLARE_EVENT_TABLE();
356
357     Timer *timer;
358     intf_thread_t *p_intf;
359
360 private:
361     int i_old_playing_status;
362
363     /* For auto-generated menus */
364     wxMenu *p_settings_menu;
365     wxMenu *p_audio_menu;
366     wxMenu *p_video_menu;
367     wxMenu *p_navig_menu;
368 };
369
370 /* Open Dialog */
371 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
372 class OpenDialog: public wxDialog
373 {
374 public:
375     /* Constructor */
376     OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
377                 int i_access_method, int i_arg = 0  );
378
379     /* Extended Contructor */
380     OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
381                 int i_access_method, int i_arg = 0 , int _i_method = 0 );
382     virtual ~OpenDialog();
383
384     int Show();
385     int Show( int i_access_method, int i_arg = 0 );
386
387     void UpdateMRL();
388     void UpdateMRL( int i_access_method );
389
390     wxArrayString mrl;
391
392 private:
393     wxPanel *FilePanel( wxWindow* parent );
394     wxPanel *DiscPanel( wxWindow* parent );
395     wxPanel *NetPanel( wxWindow* parent );
396
397     ArrayOfAutoBuiltPanel input_tab_array;
398
399     /* Event handlers (these functions should _not_ be virtual) */
400     void OnOk( wxCommandEvent& event );
401     void OnCancel( wxCommandEvent& event );
402
403     void OnPageChange( wxNotebookEvent& event );
404     void OnMRLChange( wxCommandEvent& event );
405
406     /* Event handlers for the file page */
407     void OnFilePanelChange( wxCommandEvent& event );
408     void OnFileBrowse( wxCommandEvent& event );
409
410     /* Event handlers for the disc page */
411     void OnDiscPanelChange( wxCommandEvent& event );
412     void OnDiscTypeChange( wxCommandEvent& event );
413     void OnDiscDeviceChange( wxCommandEvent& event );
414
415     /* Event handlers for the net page */
416     void OnNetPanelChange( wxCommandEvent& event );
417     void OnNetTypeChange( wxCommandEvent& event );
418
419     /* Event handlers for the stream output */
420     void OnSubsFileEnable( wxCommandEvent& event );
421     void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
422
423     /* Event handlers for the stream output */
424     void OnSoutEnable( wxCommandEvent& event );
425     void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
426
427     /* Event handlers for the caching option */
428     void OnCachingEnable( wxCommandEvent& event );
429     void OnCachingChange( wxCommandEvent& event );
430
431     DECLARE_EVENT_TABLE();
432
433     intf_thread_t *p_intf;
434     wxWindow *p_parent;
435     int i_current_access_method;
436     int i_disc_type_selection;
437
438     int i_method; /* Normal or for the stream dialog ? */
439     int i_open_arg;
440
441     wxComboBox *mrl_combo;
442     wxNotebook *notebook;
443
444     /* Controls for the file panel */
445     wxComboBox *file_combo;
446     wxFileDialog *file_dialog;
447
448     /* Controls for the disc panel */
449     wxRadioBox *disc_type;
450     wxTextCtrl *disc_device;
451     wxSpinCtrl *disc_title; int i_disc_title;
452     wxSpinCtrl *disc_chapter; int i_disc_chapter;
453     wxSpinCtrl *disc_sub; int i_disc_sub;
454
455     /* The media equivalent name for a DVD names. For example,
456      * "Title", is "Track" for a CD-DA */
457     wxStaticText *disc_title_label;
458     wxStaticText *disc_chapter_label;
459     wxStaticText *disc_sub_label;
460     
461     /* Indicates if the disc device control was modified */
462     bool b_disc_device_changed;
463     
464     /* Controls for the net panel */
465     wxRadioBox *net_type;
466     int i_net_type;
467     wxPanel *net_subpanels[4];
468     wxRadioButton *net_radios[4];
469     wxSpinCtrl *net_ports[4];
470     int        i_net_ports[4];
471     wxTextCtrl *net_addrs[4];
472     wxCheckBox *net_ipv6;
473
474     /* Controls for the subtitles file */
475     wxButton *subsfile_button;
476     wxCheckBox *subsfile_checkbox;
477     SubsFileDialog *subsfile_dialog;
478     wxArrayString subsfile_mrl;
479
480     /* Controls for the stream output */
481     wxButton *sout_button;
482     wxCheckBox *sout_checkbox;
483     SoutDialog *sout_dialog;
484     wxArrayString sout_mrl;
485
486     /* Controls for the caching options */
487     wxCheckBox *caching_checkbox;
488     wxSpinCtrl *caching_value;
489     int i_caching;
490 };
491
492 enum
493 {
494     FILE_ACCESS = 0,
495     DISC_ACCESS,
496     NET_ACCESS,
497
498     /* Auto-built panels */
499     CAPTURE_ACCESS
500 };
501 #define MAX_ACCESS CAPTURE_ACCESS
502
503 /* Stream output Dialog */
504 enum
505 {
506     PLAY_ACCESS_OUT = 0,
507     FILE_ACCESS_OUT,
508     HTTP_ACCESS_OUT,
509     MMSH_ACCESS_OUT,
510     UDP_ACCESS_OUT,
511     RTP_ACCESS_OUT,
512     ACCESS_OUT_NUM
513 };
514
515 enum
516 {
517     TS_ENCAPSULATION = 0,
518     PS_ENCAPSULATION,
519     MPEG1_ENCAPSULATION,
520     OGG_ENCAPSULATION,
521     RAW_ENCAPSULATION,
522     ASF_ENCAPSULATION,
523     AVI_ENCAPSULATION,
524     MP4_ENCAPSULATION,
525     MOV_ENCAPSULATION,
526     ENCAPS_NUM
527 };
528
529 enum
530 {
531     ANN_MISC_SOUT = 0,
532     MISC_SOUT_NUM
533 };
534
535 class SoutDialog: public wxDialog
536 {
537 public:
538     /* Constructor */
539     SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
540     virtual ~SoutDialog();
541
542     wxArrayString GetOptions();
543
544 private:
545     void UpdateMRL();
546     wxPanel *AccessPanel( wxWindow* parent );
547     wxPanel *MiscPanel( wxWindow* parent );
548     wxPanel *EncapsulationPanel( wxWindow* parent );
549     wxPanel *TranscodingPanel( wxWindow* parent );
550     void    ParseMRL();
551
552     /* Event handlers (these functions should _not_ be virtual) */
553     void OnOk( wxCommandEvent& event );
554     void OnCancel( wxCommandEvent& event );
555     void OnMRLChange( wxCommandEvent& event );
556     void OnAccessTypeChange( wxCommandEvent& event );
557
558     /* Event handlers for the file access output */
559     void OnFileChange( wxCommandEvent& event );
560     void OnFileBrowse( wxCommandEvent& event );
561     void OnFileDump( wxCommandEvent& event );
562
563     /* Event handlers for the net access output */
564     void OnNetChange( wxCommandEvent& event );
565
566     /* Event specific to the announce address */
567     void OnAnnounceAddrChange( wxCommandEvent& event );
568
569     /* Event handlers for the encapsulation panel */
570     void OnEncapsulationChange( wxCommandEvent& event );
571
572     /* Event handlers for the transcoding panel */
573     void OnTranscodingEnable( wxCommandEvent& event );
574     void OnTranscodingChange( wxCommandEvent& event );
575
576     /* Event handlers for the misc panel */
577     void OnSAPMiscChange( wxCommandEvent& event );
578     void OnSLPMiscChange( wxCommandEvent& event );
579
580     DECLARE_EVENT_TABLE();
581
582     intf_thread_t *p_intf;
583     wxWindow *p_parent;
584
585     wxComboBox *mrl_combo;
586
587     /* Controls for the access outputs */
588     wxPanel *access_panel;
589     wxPanel *access_subpanels[ACCESS_OUT_NUM];
590     wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
591
592     int i_access_type;
593
594     wxComboBox *file_combo;
595     wxCheckBox *dump_checkbox;
596     wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
597     wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
598
599     /* Controls for the SAP announces */
600     wxPanel *misc_panel;
601     wxPanel *misc_subpanels[MISC_SOUT_NUM];
602     wxCheckBox *sap_checkbox;
603     wxCheckBox *slp_checkbox;
604     wxTextCtrl *announce_addr;
605
606     /* Controls for the encapsulation */
607     wxPanel *encapsulation_panel;
608     wxRadioButton *encapsulation_radios[ENCAPS_NUM];
609     int i_encapsulation_type;
610
611     /* Controls for transcoding */
612     wxPanel *transcoding_panel;
613     wxCheckBox *video_transc_checkbox;
614     wxComboBox *video_codec_combo;
615     wxComboBox *audio_codec_combo;
616     wxCheckBox *audio_transc_checkbox;
617     wxComboBox *video_bitrate_combo;
618     wxComboBox *audio_bitrate_combo;
619     wxComboBox *audio_channels_combo;
620     wxComboBox *video_scale_combo;
621 };
622
623 /* Subtitles File Dialog */
624 class SubsFileDialog: public wxDialog
625 {
626 public:
627     /* Constructor */
628     SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
629     virtual ~SubsFileDialog();
630
631     wxComboBox *file_combo;
632     wxComboBox *encoding_combo;
633     wxComboBox *size_combo;
634     wxComboBox *align_combo;
635     wxSpinCtrl *fps_spinctrl;
636     wxSpinCtrl *delay_spinctrl;
637
638 private:
639     /* Event handlers (these functions should _not_ be virtual) */
640     void OnOk( wxCommandEvent& event );
641     void OnCancel( wxCommandEvent& event );
642     void OnFileBrowse( wxCommandEvent& event );
643
644     DECLARE_EVENT_TABLE();
645
646     intf_thread_t *p_intf;
647     wxWindow *p_parent;
648 };
649
650 /* Stream */
651 class StreamDialog: public wxFrame
652 {
653 public:
654     /* Constructor */
655     StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
656     virtual ~StreamDialog();
657
658 private:
659     void OnClose( wxCommandEvent& event );
660     void OnOpen( wxCommandEvent& event );
661     void OnSout( wxCommandEvent& event );
662     void OnStart( wxCommandEvent& event );
663
664     DECLARE_EVENT_TABLE();
665
666     intf_thread_t *p_intf;
667
668     wxStaticText *step2_label;
669     wxStaticText *step3_label;
670     wxButton *sout_button;
671     wxButton *start_button;
672     wxArrayString mrl;
673     wxArrayString sout_mrl;
674     OpenDialog *p_open_dialog;
675     SoutDialog *p_sout_dialog;
676 };
677
678 /* Wizard */
679 class WizardDialog : public wxWizard
680 {
681 public:
682     /* Constructor */
683     WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent,char *, int, int );
684     virtual ~WizardDialog();
685     void SetTranscode( char *vcodec, int vb, char *acodec,int ab);
686     void SetMrl( const char *mrl );
687     void SetTTL( int i_ttl );
688     void SetPartial( int, int );
689     void SetStream( char *method, char *address );
690     void SetTranscodeOut( char *address );
691     void SetAction( int i_action );
692     int  GetAction();
693     void SetSAP( bool b_enabled, const char *psz_name );
694     void SetMux( char *mux );
695     void Run();
696     int i_action;
697     char *method;
698
699 protected:
700     int vb,ab;
701     int i_from, i_to, i_ttl;
702     char *vcodec , *acodec , *address , *mrl , *mux ;
703     char *psz_sap_name;
704     bool b_sap;
705     DECLARE_EVENT_TABLE();
706
707     intf_thread_t *p_intf;
708 };
709
710
711 /* Preferences Dialog */
712 class PrefsDialog: public wxFrame
713 {
714 public:
715     /* Constructor */
716     PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
717     virtual ~PrefsDialog();
718
719 private:
720     wxPanel *PrefsPanel( wxWindow* parent );
721
722     /* Event handlers (these functions should _not_ be virtual) */
723     void OnOk( wxCommandEvent& event );
724     void OnCancel( wxCommandEvent& event );
725     void OnSave( wxCommandEvent& event );
726     void OnResetAll( wxCommandEvent& event );
727     void OnAdvanced( wxCommandEvent& event );
728
729     DECLARE_EVENT_TABLE();
730
731     intf_thread_t *p_intf;
732
733     PrefsTreeCtrl *prefs_tree;
734 };
735
736 /* Messages */
737 class Messages: public wxFrame
738 {
739 public:
740     /* Constructor */
741     Messages( intf_thread_t *p_intf, wxWindow *p_parent );
742     virtual ~Messages();
743     bool Show( bool show = TRUE );
744     void UpdateLog();
745
746 private:
747     /* Event handlers (these functions should _not_ be virtual) */
748     void OnClose( wxCommandEvent& event );
749     void OnClear( wxCommandEvent& event );
750     void OnSaveLog( wxCommandEvent& event );
751
752     DECLARE_EVENT_TABLE();
753
754     intf_thread_t *p_intf;
755     wxTextCtrl *textctrl;
756     wxTextAttr *info_attr;
757     wxTextAttr *err_attr;
758     wxTextAttr *warn_attr;
759     wxTextAttr *dbg_attr;
760
761     wxFileDialog *save_log_dialog;
762
763     vlc_bool_t b_verbose;
764 };
765
766 /* Playlist */
767 class Playlist: public wxFrame
768 {
769 public:
770     /* Constructor */
771     Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
772     virtual ~Playlist();
773
774     void UpdatePlaylist();
775     void ShowPlaylist( bool show );
776     void UpdateItem( int );
777
778     bool b_need_update;
779
780 private:
781     void DeleteItem( int item );
782     void ShowInfos( int item );
783
784     /* Event handlers (these functions should _not_ be virtual) */
785
786     void OnSize( wxSizeEvent &event );
787
788     void OnAddFile( wxCommandEvent& event );
789     void OnAddMRL( wxCommandEvent& event );
790     void OnClose( wxCommandEvent& event );
791     void OnSearch( wxCommandEvent& event );
792     void OnEnDis( wxCommandEvent& event );
793     void OnInfos( wxCommandEvent& event );
794     void OnSearchTextChange( wxCommandEvent& event );
795     void OnOpen( wxCommandEvent& event );
796     void OnSave( wxCommandEvent& event );
797
798     void OnSort( wxCommandEvent& event );
799     void OnColSelect( wxListEvent& event );
800
801     void OnUp( wxCommandEvent& event);
802     void OnDown( wxCommandEvent& event);
803
804     void OnEnableSelection( wxCommandEvent& event );
805     void OnDisableSelection( wxCommandEvent& event );
806     void OnInvertSelection( wxCommandEvent& event );
807     void OnDeleteSelection( wxCommandEvent& event );
808     void OnSelectAll( wxCommandEvent& event );
809     void OnRandom( wxCommandEvent& event );
810     void OnRepeat( wxCommandEvent& event );
811     void OnLoop ( wxCommandEvent& event );
812     void OnActivateItem( wxListEvent& event );
813     void OnKeyDown( wxListEvent& event );
814     void OnNewGroup( wxCommandEvent& event );
815
816     /* Popup functions */
817     void OnPopup( wxListEvent& event );
818     void OnPopupPlay( wxMenuEvent& event );
819     void OnPopupDel( wxMenuEvent& event );
820     void OnPopupEna( wxMenuEvent& event );
821     void OnPopupInfo( wxMenuEvent& event );
822     void Rebuild();
823
824     /* Custom events */
825     void OnPlaylistEvent( wxCommandEvent& event );
826
827     wxTextCtrl *search_text;
828     wxButton *search_button;
829     DECLARE_EVENT_TABLE();
830
831     wxMenu *popup_menu;
832
833     ItemInfoDialog *iteminfo_dialog;
834
835     intf_thread_t *p_intf;
836     wxListView *listview;
837     wxTreeCtrl *treeview;
838     int i_update_counter;
839     int i_sort_mode;
840
841     int i_popup_item;
842
843     int i_title_sorted;
844     int i_author_sorted;
845     int i_group_sorted;
846     int i_duration_sorted;
847 };
848
849 class NewGroup: public wxDialog
850 {
851 public:
852     /* Constructor */
853     NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
854     virtual ~NewGroup();
855
856 private:
857
858     /* Event handlers (these functions should _not_ be virtual) */
859     void OnOk( wxCommandEvent& event );
860     void OnCancel( wxCommandEvent& event );
861
862     DECLARE_EVENT_TABLE();
863
864     intf_thread_t *p_intf;
865     wxTextCtrl *groupname;
866
867 protected:
868     friend class Playlist;
869     friend class ItemInfoDialog;
870     char *psz_name;
871 };
872
873 /* ItemInfo Dialog */
874 class ItemInfoDialog: public wxDialog
875 {
876 public:
877     /* Constructor */
878     ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
879                     wxWindow *p_parent );
880     virtual ~ItemInfoDialog();
881
882     wxArrayString GetOptions();
883
884 private:
885     wxPanel *InfoPanel( wxWindow* parent );
886     wxPanel *GroupPanel( wxWindow* parent );
887
888     /* Event handlers (these functions should _not_ be virtual) */
889     void OnOk( wxCommandEvent& event );
890     void OnCancel( wxCommandEvent& event );
891     void OnNewGroup( wxCommandEvent& event );
892
893     void UpdateInfo();
894
895     DECLARE_EVENT_TABLE();
896
897     intf_thread_t *p_intf;
898     playlist_item_t *p_item;
899     wxWindow *p_parent;
900
901     /* Controls for the iteminfo dialog box */
902     wxPanel *info_subpanel;
903     wxPanel *info_panel;
904
905     wxPanel *group_subpanel;
906     wxPanel *group_panel;
907
908     wxTextCtrl *uri_text;
909     wxTextCtrl *name_text;
910     wxTextCtrl *author_text;
911
912     wxTreeCtrl *info_tree;
913     wxTreeItemId info_root;
914
915     wxCheckBox *enabled_checkbox;
916     wxComboBox *group_combo;
917     int ids_array[100];
918 };
919
920
921 /* File Info */
922 class FileInfo: public wxFrame
923 {
924 public:
925     /* Constructor */
926     FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
927     virtual ~FileInfo();
928     void UpdateFileInfo();
929
930     vlc_bool_t b_need_update;
931
932 private:
933     void OnClose( wxCommandEvent& event );
934
935     DECLARE_EVENT_TABLE();
936
937     intf_thread_t *p_intf;
938     wxTreeCtrl *fileinfo_tree;
939     wxTreeItemId fileinfo_root;
940     wxString fileinfo_root_label;
941
942
943 };
944
945 #if wxUSE_DRAG_AND_DROP
946 /* Drag and Drop class */
947 class DragAndDrop: public wxFileDropTarget
948 {
949 public:
950     DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
951
952     virtual bool OnDropFiles( wxCoord x, wxCoord y,
953                               const wxArrayString& filenames );
954
955 private:
956     intf_thread_t *p_intf;
957     vlc_bool_t b_enqueue;
958 };
959 #endif
960 } // end of wxvlc namespace
961
962 /* Menus */
963 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
964 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
965 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
966 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
967 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
968
969 namespace wxvlc
970 {
971 class MenuEvtHandler : public wxEvtHandler
972 {
973 public:
974     MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
975     virtual ~MenuEvtHandler();
976
977     void OnMenuEvent( wxCommandEvent& event );
978     void OnShowDialog( wxCommandEvent& event );
979
980 private:
981
982     DECLARE_EVENT_TABLE()
983
984     intf_thread_t *p_intf;
985     Interface *p_main_interface;
986 };
987
988 } // end of wxvlc namespace
989 using namespace wxvlc;