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