1 /*****************************************************************************
2 * open.hpp : Panels for the open dialogs
3 ****************************************************************************
4 * Copyright (C) 2006-2009 the VideoLAN team
5 * Copyright (C) 2007 Société des arts technologiques
6 * Copyright (C) 2007 Savoir-faire Linux
9 * Authors: Clément Stenac <zorglub@videolan.org>
10 * Jean-Baptiste Kempf <jb@videolan.org>
11 * Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26 *****************************************************************************/
28 #ifndef _OPENPANELS_H_
29 #define _OPENPANELS_H_
35 #include "components/preferences_widgets.hpp"
37 #include "ui/open_file.h"
38 #include "ui/open_disk.h"
39 #include "ui/open_net.h"
40 #include "ui/open_capture.h"
42 #include <QFileDialog>
46 #define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \
47 spinbox->setAccelerated( true ); }
77 class QStringListModel;
79 class OpenPanel: public QWidget
83 OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
87 virtual ~OpenPanel() {};
88 virtual void clear() = 0;
90 intf_thread_t *p_intf;
92 virtual void updateMRL() = 0;
94 void mrlUpdated( const QStringList&, const QString& );
95 void methodChanged( const QString& method );
98 class FileOpenBox: public QFileDialog
102 FileOpenBox( QWidget *parent, const QString &caption,
103 const QString &directory, const QString &filter ):
104 QFileDialog( parent, caption, directory, filter ) {}
111 class FileOpenPanel: public OpenPanel
115 FileOpenPanel( QWidget *, intf_thread_t * );
116 virtual ~FileOpenPanel();
117 virtual void clear() ;
118 virtual void accept() ;
120 bool eventFilter(QObject *obj, QEvent *event)
122 if( event->type() == QEvent::Hide ||
123 event->type() == QEvent::HideToParent )
132 FileOpenBox *dialogBox;
133 void BuildOldPanel();
135 virtual void updateMRL();
137 void browseFileSub();
140 void updateButtons();
141 void toggleSubtitleFrame( bool );
144 class NetOpenPanel: public OpenPanel
148 NetOpenPanel( QWidget *, intf_thread_t * );
149 virtual ~NetOpenPanel();
150 virtual void clear() ;
153 QStringListModel *mrlList;
155 virtual void updateMRL();
157 void updateProtocol( int );
158 void updateCompleter();
161 class DiscOpenPanel: public OpenPanel
165 DiscOpenPanel( QWidget *, intf_thread_t * );
166 virtual ~DiscOpenPanel();
167 virtual void clear() ;
168 virtual void accept() ;
171 char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath;
172 bool b_firstdvd, b_firstvcd, b_firstcdda;
174 virtual void updateMRL() ;
177 void updateButtons() ;
182 class CaptureOpenPanel: public OpenPanel
186 CaptureOpenPanel( QWidget *, intf_thread_t * );
187 virtual ~CaptureOpenPanel();
188 virtual void clear() ;
196 QRadioButton *bdas, *bdat, *bdac, *bdaa;
197 QSpinBox *bdaCard, *bdaFreq, *bdaSrate;
198 QLabel *bdaSrateLabel, *bdaBandLabel;
199 QComboBox *bdaBandBox;
200 StringListConfigControl *vdevDshowW, *adevDshowW;
201 QLineEdit *dshowVSizeLine;
203 QRadioButton *dvbs, *dvbt, *dvbc;
204 QLabel *dvbBandLabel, *dvbSrateLabel;
205 QSpinBox *v4lFreq, *pvrFreq, *pvrBitr;
206 QLineEdit *v4lVideoDevice, *v4lAudioDevice;
207 QLineEdit *v4l2VideoDevice, *v4l2AudioDevice;
208 QLineEdit *pvrDevice, *pvrRadioDevice;
209 QComboBox *v4lNormBox, *v4l2StdBox, *pvrNormBox, *dvbBandBox;
210 QSpinBox *dvbCard, *dvbFreq, *dvbSrate;
211 QSpinBox *jackChannels, *jackCaching;
212 QCheckBox *jackPace, *jackConnect;
213 QLineEdit *jackPortsSelected;
218 virtual void updateMRL();
221 void updateButtons();
222 void advancedDialog();