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 ); }
62 class QStringListModel;
65 class OpenPanel: public QWidget
69 OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
73 virtual ~OpenPanel() {};
74 virtual void clear() = 0;
75 virtual void onFocus() {}
77 intf_thread_t *p_intf;
79 virtual void updateMRL() = 0;
81 void mrlUpdated( const QStringList&, const QString& );
82 void methodChanged( const QString& method );
85 class FileOpenBox: public QFileDialog
89 FileOpenBox( QWidget *parent, const QString &caption,
90 const QString &directory, const QString &filter ):
91 QFileDialog( parent, caption, directory, filter ) {}
98 class FileOpenPanel: public OpenPanel
102 FileOpenPanel( QWidget *, intf_thread_t * );
103 virtual ~FileOpenPanel();
104 virtual void clear() ;
105 virtual void accept() ;
107 bool eventFilter(QObject *obj, QEvent *event)
109 if( event->type() == QEvent::Hide ||
110 event->type() == QEvent::HideToParent )
117 virtual void dropEvent( QDropEvent *);
118 virtual void dragEnterEvent( QDragEnterEvent * );
119 virtual void dragMoveEvent( QDragMoveEvent * );
120 virtual void dragLeaveEvent( QDragLeaveEvent * );
123 FileOpenBox *dialogBox;
124 void BuildOldPanel();
126 virtual void updateMRL();
128 void browseFileSub();
131 void updateButtons();
132 void toggleSubtitleFrame( bool );
135 class NetOpenPanel: public OpenPanel
139 NetOpenPanel( QWidget *, intf_thread_t * );
140 virtual ~NetOpenPanel();
141 virtual void clear() ;
145 QStringListModel *mrlList;
147 virtual void updateMRL();
152 class UrlValidator : public QValidator
156 UrlValidator( QObject *parent ) : QValidator( parent ) { }
157 void fixup( QString& ) const;
158 QValidator::State validate( QString&, int& ) const;
161 class DiscOpenPanel: public OpenPanel
172 DiscOpenPanel( QWidget *, intf_thread_t * );
173 virtual ~DiscOpenPanel();
174 virtual void clear() ;
175 virtual void accept() ;
178 char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath;
181 virtual void updateMRL() ;
184 void updateButtons() ;
189 class CaptureOpenPanel: public OpenPanel
193 CaptureOpenPanel( QWidget *, intf_thread_t * );
194 virtual ~CaptureOpenPanel();
195 virtual void clear() ;
203 StringListConfigControl *vdevDshowW, *adevDshowW;
204 QLineEdit *dshowVSizeLine;
206 QSpinBox *pvrFreq, *pvrBitr;
207 QComboBox *v4l2VideoDevice, *v4l2AudioDevice;
208 QLineEdit *pvrDevice, *pvrRadioDevice;
209 QComboBox *v4l2StdBox, *pvrNormBox;
210 QSpinBox *jackChannels, *jackCaching;
211 QCheckBox *jackPace, *jackConnect;
212 QLineEdit *jackPortsSelected;
214 QRadioButton *dvbc, *dvbs, *dvbs2, *dvbt, *atsc, *cqam;
215 QLabel *dvbBandLabel, *dvbSrateLabel, *dvbModLabel;
216 QComboBox *dvbQamBox, *dvbPskBox, *dvbBandBox;
217 QSpinBox *dvbCard, *dvbFE, *dvbFreq, *dvbSrate;
218 QDoubleSpinBox *screenFPS;
221 virtual void updateMRL();
224 void updateButtons();
225 void advancedDialog();