1 /*****************************************************************************
2 * open.hpp: Headers for the Open dialog
3 *****************************************************************************
4 * Copyright (C) 1999-2005 the VideoLAN team
7 * Authors: Gildas Bazin <gbazin@videolan.org>
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.
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.
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 *****************************************************************************/
24 #ifndef _WXVLC_OPEN_H_
25 #define _WXVLC_OPEN_H_
27 #include "wxwidgets.hpp"
29 #include <wx/spinctrl.h>
30 #include <wx/notebook.h>
37 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
39 class OpenDialog: public wxDialog
44 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
45 int i_access_method, int i_arg = 0 );
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();
53 int Show( int i_access_method, int i_arg = 0 );
56 void UpdateMRL( int i_access_method );
61 wxPanel *FilePanel( wxWindow* parent );
62 wxPanel *DiscPanel( wxWindow* parent );
63 wxPanel *NetPanel( wxWindow* parent );
65 ArrayOfAutoBuiltPanel input_tab_array;
67 /* Event handlers (these functions should _not_ be virtual) */
68 void OnOk( wxCommandEvent& event );
69 void OnCancel( wxCommandEvent& event );
70 void OnClose( wxCloseEvent& event );
72 void OnPageChange( wxNotebookEvent& event );
73 void OnMRLChange( wxCommandEvent& event );
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 );
81 /* Event handlers for the disc page */
82 void OnDiscPanelChangeSpin( wxSpinEvent& event );
83 void OnDiscPanelChange( wxCommandEvent& event );
84 void OnDiscTypeChange( wxCommandEvent& event );
86 void OnDiscProbe( wxCommandEvent& event );
88 void OnDiscDeviceChange( wxCommandEvent& event );
90 /* Event handlers for the net page */
91 void OnNetPanelChangeSpin( wxSpinEvent& event );
92 void OnNetPanelChange( wxCommandEvent& event );
93 void OnNetTypeChange( wxCommandEvent& event );
95 /* Event handlers for the stream output */
96 void OnSubsFileEnable( wxCommandEvent& event );
97 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
99 /* Event handlers for the stream output */
100 void OnSoutEnable( wxCommandEvent& event );
101 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
103 /* Event handlers for the caching option */
104 void OnCachingEnable( wxCommandEvent& event );
105 void OnCachingChange( wxCommandEvent& event );
106 void OnCachingChangeSpin( wxSpinEvent& event );
108 DECLARE_EVENT_TABLE();
110 intf_thread_t *p_intf;
112 int i_current_access_method;
113 int i_disc_type_selection;
115 int i_method; /* Normal or for the stream dialog ? */
118 wxComboBox *mrl_combo;
119 wxNotebook *notebook;
121 /* Controls for the file panel */
122 wxComboBox *file_combo;
123 wxComboBox *subfile_combo;
124 wxFileDialog *file_dialog;
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;
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;
142 /* Indicates if the disc device control was modified */
143 bool b_disc_device_changed;
145 /* Controls for the net panel */
146 wxRadioBox *net_type;
148 wxPanel *net_subpanels[4];
149 wxRadioButton *net_radios[4];
150 wxSpinCtrl *net_ports[4];
152 wxTextCtrl *net_addrs[4];
153 wxCheckBox *net_timeshift;
154 wxCheckBox *net_ipv6;
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;
163 /* Controls for the stream output */
164 wxButton *sout_button;
165 wxCheckBox *sout_checkbox;
166 SoutDialog *sout_dialog;
167 wxArrayString sout_mrl;
169 /* Controls for the caching options */
170 wxCheckBox *caching_checkbox;
171 wxSpinCtrl *caching_value;
183 /* Auto-built panels */
186 #define MAX_ACCESS CAPTURE_ACCESS