1 /*****************************************************************************
2 * open.hpp : Panels for the open dialogs
3 ****************************************************************************
4 * Copyright (C) 2006-2008 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 ); }
74 static const char *psz_devModule[] = { "v4l", "v4l2", "pvr", "dvb", "bda",
75 "dshow", "screen", "jack" };
80 class QStringListModel;
82 class OpenPanel: public QWidget
86 OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
90 virtual ~OpenPanel() {};
91 virtual void clear() = 0;
93 intf_thread_t *p_intf;
95 virtual void updateMRL() = 0;
97 void mrlUpdated( QString );
98 void methodChanged( QString method );
101 class FileOpenBox: public QFileDialog
105 FileOpenBox( QWidget *parent, const QString &caption,
106 const QString &directory, const QString &filter ):
107 QFileDialog( parent, caption, directory, filter ) {}
113 class FileOpenPanel: public OpenPanel
117 FileOpenPanel( QWidget *, intf_thread_t * );
118 virtual ~FileOpenPanel();
119 virtual void clear() ;
120 virtual void accept() ;
123 QStringList browse( QString );
124 FileOpenBox *dialogBox;
125 QLineEdit *lineFileEdit;
126 QStringList fileCompleteList ;
128 virtual void updateMRL();
130 void browseFileSub();
131 void toggleSubtitleFrame();
134 class NetOpenPanel: public OpenPanel
138 NetOpenPanel( QWidget *, intf_thread_t * );
139 virtual ~NetOpenPanel();
140 virtual void clear() ;
143 QStringListModel *mrlList;
145 virtual void updateMRL();
147 void updateProtocol( int );
148 void updateCompleter();
151 class DiscOpenPanel: public OpenPanel
155 DiscOpenPanel( QWidget *, intf_thread_t * );
156 virtual ~DiscOpenPanel();
157 virtual void clear() ;
158 virtual void accept() ;
161 char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath;
162 bool b_firstdvd, b_firstvcd, b_firstcdda;
164 virtual void updateMRL() ;
167 void updateButtons() ;
172 class CaptureOpenPanel: public OpenPanel
176 CaptureOpenPanel( QWidget *, intf_thread_t * );
177 virtual ~CaptureOpenPanel();
178 virtual void clear() ;
186 QRadioButton *bdas, *bdat, *bdac, *bdaa;
187 QSpinBox *bdaCard, *bdaFreq, *bdaSrate;
188 QLabel *bdaSrateLabel, *bdaBandLabel;
189 QComboBox *bdaBandBox;
190 StringListConfigControl *vdevDshowW, *adevDshowW;
191 QLineEdit *dshowVSizeLine;
193 QRadioButton *dvbs, *dvbt, *dvbc;
194 QSpinBox *v4lFreq, *pvrFreq, *pvrBitr;
195 QLineEdit *v4lVideoDevice, *v4lAudioDevice;
196 QLineEdit *v4l2VideoDevice, *v4l2AudioDevice;
197 QLineEdit *pvrDevice, *pvrRadioDevice;
198 QComboBox *v4lNormBox, *v4l2StdBox, *pvrNormBox;
199 QSpinBox *dvbCard, *dvbFreq, *dvbSrate;
200 QSpinBox *jackChannels, *jackCaching;
201 QCheckBox *jackPace, *jackConnect;
202 QLineEdit *jackPortsSelected;
207 virtual void updateMRL();
210 void updateButtons();
211 void advancedDialog();