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 $
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>
36 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
38 class OpenDialog: public wxDialog
43 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
44 int i_access_method, int i_arg = 0 );
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();
52 int Show( int i_access_method, int i_arg = 0 );
55 void UpdateMRL( int i_access_method );
60 wxPanel *FilePanel( wxWindow* parent );
61 wxPanel *DiscPanel( wxWindow* parent );
62 wxPanel *NetPanel( wxWindow* parent );
64 ArrayOfAutoBuiltPanel input_tab_array;
66 /* Event handlers (these functions should _not_ be virtual) */
67 void OnOk( wxCommandEvent& event );
68 void OnCancel( wxCommandEvent& event );
69 void OnClose( wxCloseEvent& event );
71 void OnPageChange( wxNotebookEvent& event );
72 void OnMRLChange( wxCommandEvent& event );
74 /* Event handlers for the file page */
75 void OnFilePanelChange( wxCommandEvent& event );
76 void OnFileBrowse( wxCommandEvent& event );
78 /* Event handlers for the disc page */
79 void OnDiscPanelChangeSpin( wxSpinEvent& event );
80 void OnDiscPanelChange( wxCommandEvent& event );
81 void OnDiscTypeChange( wxCommandEvent& event );
83 void OnDiscProbe( wxCommandEvent& event );
85 void OnDiscDeviceChange( wxCommandEvent& event );
87 /* Event handlers for the net page */
88 void OnNetPanelChangeSpin( wxSpinEvent& event );
89 void OnNetPanelChange( wxCommandEvent& event );
90 void OnNetTypeChange( wxCommandEvent& event );
92 /* Event handlers for the stream output */
93 void OnSubsFileEnable( wxCommandEvent& event );
94 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
96 /* Event handlers for the stream output */
97 void OnSoutEnable( wxCommandEvent& event );
98 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
100 /* Event handlers for the caching option */
101 void OnCachingEnable( wxCommandEvent& event );
102 void OnCachingChange( wxCommandEvent& event );
103 void OnCachingChangeSpin( wxSpinEvent& event );
105 DECLARE_EVENT_TABLE();
107 intf_thread_t *p_intf;
109 int i_current_access_method;
110 int i_disc_type_selection;
112 int i_method; /* Normal or for the stream dialog ? */
115 wxComboBox *mrl_combo;
116 wxNotebook *notebook;
118 /* Controls for the file panel */
119 wxComboBox *file_combo;
120 wxFileDialog *file_dialog;
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;
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;
138 /* Indicates if the disc device control was modified */
139 bool b_disc_device_changed;
141 /* Controls for the net panel */
142 wxRadioBox *net_type;
144 wxPanel *net_subpanels[4];
145 wxRadioButton *net_radios[4];
146 wxSpinCtrl *net_ports[4];
148 wxTextCtrl *net_addrs[4];
149 wxCheckBox *net_timeshift;
150 wxCheckBox *net_ipv6;
152 /* Controls for the subtitles file */
153 wxButton *subsfile_button;
154 wxCheckBox *subsfile_checkbox;
155 SubsFileDialog *subsfile_dialog;
156 wxArrayString subsfile_mrl;
158 /* Controls for the stream output */
159 wxButton *sout_button;
160 wxCheckBox *sout_checkbox;
161 SoutDialog *sout_dialog;
162 wxArrayString sout_mrl;
164 /* Controls for the caching options */
165 wxCheckBox *caching_checkbox;
166 wxSpinCtrl *caching_value;
178 /* Auto-built panels */
181 #define MAX_ACCESS CAPTURE_ACCESS