1 /*****************************************************************************
2 * open.hpp : Panels for the open dialogs
3 ****************************************************************************
4 * Copyright (C) 2006-2007 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_
33 #include <QFileDialog>
35 #include "ui/open_file.h"
36 #include "ui/open_disk.h"
37 #include "ui/open_net.h"
38 #include "ui/open_capture.h"
40 #include "components/preferences_widgets.hpp"
46 #define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \
47 spinbox->setAccelerated( true ); }
61 static const char *psz_devModule[] = { "v4l", "v4l2", "pvr", "dvb", "bda",
62 "dshow", "screen", "jack" };
69 class OpenPanel: public QWidget
73 OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
77 virtual ~OpenPanel() {};
78 virtual void clear() = 0;
80 intf_thread_t *p_intf;
82 virtual void updateMRL() = 0;
84 void mrlUpdated( QString );
85 void methodChanged( QString method );
88 class FileOpenBox: public QFileDialog
92 FileOpenBox( QWidget *parent, const QString &caption,
93 const QString &directory, const QString &filter ):
94 QFileDialog( parent, caption, directory, filter ) {}
99 class FileOpenPanel: public OpenPanel
103 FileOpenPanel( QWidget *, intf_thread_t * );
104 virtual ~FileOpenPanel();
105 virtual void clear() ;
106 virtual void accept() ;
109 QStringList browse( QString );
110 FileOpenBox *dialogBox;
111 QLineEdit *lineFileEdit;
112 QStringList fileCompleteList ;
114 virtual void updateMRL();
116 void browseFileSub();
117 void toggleSubtitleFrame();
120 class NetOpenPanel: public OpenPanel
124 NetOpenPanel( QWidget *, intf_thread_t * );
125 virtual ~NetOpenPanel();
126 virtual void clear() ;
130 virtual void updateMRL();
132 void updateProtocol( int );
135 class DiscOpenPanel: public OpenPanel
139 DiscOpenPanel( QWidget *, intf_thread_t * );
140 virtual ~DiscOpenPanel();
141 virtual void clear() ;
142 virtual void accept() ;
145 char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath;
146 bool b_firstdvd, b_firstvcd, b_firstcdda;
148 virtual void updateMRL() ;
151 void updateButtons() ;
155 class CaptureOpenPanel: public OpenPanel
159 CaptureOpenPanel( QWidget *, intf_thread_t * );
160 virtual ~CaptureOpenPanel();
161 virtual void clear() ;
167 QRadioButton *bdas, *bdat, *bdac;
168 QSpinBox *bdaCard, *bdaFreq, *bdaSrate;
169 QLabel *bdaSrateLabel, *bdaBandLabel;
170 QComboBox *bdaBandBox;
171 StringListConfigControl *vdevDshowW, *adevDshowW;
172 QLineEdit *dshowVSizeLine;
174 QRadioButton *dvbs, *dvbt, *dvbc;
175 QSpinBox *v4lFreq, *pvrFreq, *pvrBitr;
176 QLineEdit *v4lVideoDevice, *v4lAudioDevice;
177 QLineEdit *v4l2VideoDevice, *v4l2AudioDevice;
178 QLineEdit *pvrDevice, *pvrRadioDevice;
179 QComboBox *v4lNormBox, *v4l2StdBox, *pvrNormBox;
180 QSpinBox *dvbCard, *dvbFreq, *dvbSrate;
181 QSpinBox *jackChannels, *jackCaching;
182 QCheckBox *jackPace, *jackConnect;
183 QLineEdit *jackPortsSelected;
187 virtual void updateMRL();
189 void updateButtons();
190 void advancedDialog();