]> git.sesse.net Git - vlc/blob - modules/gui/wxwidgets/dialogs/open.hpp
c09b6429a4663400c51c8a61c26a341b9048c13c
[vlc] / modules / gui / wxwidgets / dialogs / open.hpp
1 /*****************************************************************************
2  * open.hpp: Headers for the Open dialog
3  *****************************************************************************
4  * Copyright (C) 1999-2005 the VideoLAN team
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 #ifndef _WXVLC_OPEN_H_
25 #define _WXVLC_OPEN_H_
26
27 #include "wxwidgets.hpp"
28
29 #include <wx/spinctrl.h>
30 #include <wx/notebook.h>
31
32 class AutoBuiltPanel;
33 namespace wxvlc
34 {
35     class SubsFileDialog;
36     class SoutDialog;
37     WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
38
39     class OpenDialog: public wxDialog
40     {
41
42 public:
43     /* Constructor */
44     OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
45                 int i_access_method, int i_arg = 0  );
46
47     /* Extended Contructor */
48     OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
49                 int i_access_method, int i_arg = 0 , int _i_method = 0 );
50     virtual ~OpenDialog();
51
52     int Show();
53     int Show( int i_access_method, int i_arg = 0 );
54
55     void UpdateMRL();
56     void UpdateMRL( int i_access_method );
57
58     wxArrayString mrl;
59
60 private:
61     wxPanel *FilePanel( wxWindow* parent );
62     wxPanel *DiscPanel( wxWindow* parent );
63     wxPanel *NetPanel( wxWindow* parent );
64
65     ArrayOfAutoBuiltPanel input_tab_array;
66
67     /* Event handlers (these functions should _not_ be virtual) */
68     void OnOk( wxCommandEvent& event );
69     void OnCancel( wxCommandEvent& event );
70     void OnClose( wxCloseEvent& event );
71
72     void OnPageChange( wxNotebookEvent& event );
73     void OnMRLChange( wxCommandEvent& event );
74
75     /* Event handlers for the file page */
76     void OnFilePanelChange( wxCommandEvent& event );
77     void OnFileBrowse( wxCommandEvent& event );
78     void OnSubFileBrowse( wxCommandEvent& event );
79     void OnSubFileChange( wxCommandEvent& event );
80
81     /* Event handlers for the disc page */
82     void OnDiscPanelChangeSpin( wxSpinEvent& event );
83     void OnDiscPanelChange( wxCommandEvent& event );
84     void OnDiscTypeChange( wxCommandEvent& event );
85 #ifdef HAVE_LIBCDIO
86     void OnDiscProbe( wxCommandEvent& event );
87 #endif
88     void OnDiscDeviceChange( wxCommandEvent& event );
89
90     /* Event handlers for the net page */
91     void OnNetPanelChangeSpin( wxSpinEvent& event );
92     void OnNetPanelChange( wxCommandEvent& event );
93     void OnNetTypeChange( wxCommandEvent& event );
94
95     /* Event handlers for the stream output */
96     void OnSubsFileEnable( wxCommandEvent& event );
97     void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
98
99     /* Event handlers for the stream output */
100     void OnSoutEnable( wxCommandEvent& event );
101     void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
102
103     /* Event handlers for the caching option */
104     void OnCachingEnable( wxCommandEvent& event );
105     void OnCachingChange( wxCommandEvent& event );
106     void OnCachingChangeSpin( wxSpinEvent& event );
107
108     DECLARE_EVENT_TABLE();
109
110     intf_thread_t *p_intf;
111     wxWindow *p_parent;
112     int i_current_access_method;
113     int i_disc_type_selection;
114
115     int i_method; /* Normal or for the stream dialog ? */
116     int i_open_arg;
117
118     wxComboBox *mrl_combo;
119     wxNotebook *notebook;
120
121     /* Controls for the file panel */
122     wxComboBox *file_combo;
123     wxComboBox *subfile_combo;
124     wxFileDialog *file_dialog;
125
126     /* Controls for the disc panel */
127     wxRadioBox *disc_type;
128     wxCheckBox *disc_probe;
129     wxTextCtrl *disc_device;
130     wxSpinCtrl *disc_title; int i_disc_title;
131     wxSpinCtrl *disc_chapter; int i_disc_chapter;
132     wxSpinCtrl *disc_sub; int i_disc_sub;
133     wxSpinCtrl *disc_audio; int i_disc_audio;
134
135     /* The media equivalent name for a DVD names. For example,
136      * "Title", is "Track" for a CD-DA */
137     wxStaticText *disc_title_label;
138     wxStaticText *disc_chapter_label;
139     wxStaticText *disc_sub_label;
140     wxStaticText *disc_audio_label;
141
142     /* Indicates if the disc device control was modified */
143     bool b_disc_device_changed;
144
145     /* Controls for the net panel */
146     wxRadioBox *net_type;
147     int i_net_type;
148     wxPanel *net_subpanels[4];
149     wxRadioButton *net_radios[4];
150     wxSpinCtrl *net_ports[4];
151     int        i_net_ports[4];
152     wxTextCtrl *net_addrs[4];
153     wxCheckBox *net_timeshift;
154     wxCheckBox *net_ipv6;
155
156     /* Controls for the subtitles file */
157     wxButton *subsfile_button;
158     wxButton *subbrowse_button;
159     wxCheckBox *subsfile_checkbox;
160     SubsFileDialog *subsfile_dialog;
161     wxArrayString subsfile_mrl;
162
163     /* Controls for the stream output */
164     wxButton *sout_button;
165     wxCheckBox *sout_checkbox;
166     SoutDialog *sout_dialog;
167     wxArrayString sout_mrl;
168
169     /* Controls for the caching options */
170     wxCheckBox *caching_checkbox;
171     wxSpinCtrl *caching_value;
172     int i_caching;
173 };
174
175 };
176
177 enum
178 {
179     FILE_ACCESS = 0,
180     DISC_ACCESS,
181     NET_ACCESS,
182
183     /* Auto-built panels */
184     CAPTURE_ACCESS
185 };
186 #define MAX_ACCESS CAPTURE_ACCESS
187
188
189 #endif