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_
37 #include <QFileDialog>
39 #include "ui/open_file.h"
40 #include "ui/open_disk.h"
41 #include "ui/open_net.h"
42 #include "ui/open_capture.h"
44 #include "components/preferences_widgets.hpp"
48 #define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \
49 spinbox->setAccelerated( true ); }
63 static const char *psz_devModule[] = { "v4l", "v4l2", "pvr", "dvb", "bda",
64 "dshow", "screen", "jack" };
71 class OpenPanel: public QWidget
75 OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
79 virtual ~OpenPanel() {};
80 virtual void clear() = 0;
82 intf_thread_t *p_intf;
84 virtual void updateMRL() = 0;
86 void mrlUpdated( QString );
87 void methodChanged( QString method );
90 class FileOpenBox: public QFileDialog
94 FileOpenBox( QWidget *parent, const QString &caption,
95 const QString &directory, const QString &filter ):
96 QFileDialog( parent, caption, directory, filter ) {}
101 class FileOpenPanel: public OpenPanel
105 FileOpenPanel( QWidget *, intf_thread_t * );
106 virtual ~FileOpenPanel();
107 virtual void clear() ;
108 virtual void accept() ;
111 QStringList browse( QString );
112 FileOpenBox *dialogBox;
113 QLineEdit *lineFileEdit;
114 QStringList fileCompleteList ;
116 virtual void updateMRL();
118 void browseFileSub();
119 void toggleSubtitleFrame();
122 class NetOpenPanel: public OpenPanel
126 NetOpenPanel( QWidget *, intf_thread_t * );
127 virtual ~NetOpenPanel();
128 virtual void clear() ;
132 virtual void updateMRL();
134 void updateProtocol( int );
137 class DiscOpenPanel: public OpenPanel
141 DiscOpenPanel( QWidget *, intf_thread_t * );
142 virtual ~DiscOpenPanel();
143 virtual void clear() ;
144 virtual void accept() ;
147 char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath;
148 bool b_firstdvd, b_firstvcd, b_firstcdda;
150 virtual void updateMRL() ;
153 void updateButtons() ;
158 class CaptureOpenPanel: public OpenPanel
162 CaptureOpenPanel( QWidget *, intf_thread_t * );
163 virtual ~CaptureOpenPanel();
164 virtual void clear() ;
170 QRadioButton *bdas, *bdat, *bdac;
171 QSpinBox *bdaCard, *bdaFreq, *bdaSrate;
172 QLabel *bdaSrateLabel, *bdaBandLabel;
173 QComboBox *bdaBandBox;
174 StringListConfigControl *vdevDshowW, *adevDshowW;
175 QLineEdit *dshowVSizeLine;
177 QRadioButton *dvbs, *dvbt, *dvbc;
178 QSpinBox *v4lFreq, *pvrFreq, *pvrBitr;
179 QLineEdit *v4lVideoDevice, *v4lAudioDevice;
180 QLineEdit *v4l2VideoDevice, *v4l2AudioDevice;
181 QLineEdit *pvrDevice, *pvrRadioDevice;
182 QComboBox *v4lNormBox, *v4l2StdBox, *pvrNormBox;
183 QSpinBox *dvbCard, *dvbFreq, *dvbSrate;
184 QSpinBox *jackChannels, *jackCaching;
185 QCheckBox *jackPace, *jackConnect;
186 QLineEdit *jackPortsSelected;
190 virtual void updateMRL();
192 void updateButtons();
193 void advancedDialog();