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"
44 #define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \
45 spinbox->setAccelerated( true ); }
63 class OpenPanel: public QWidget
67 OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
71 virtual ~OpenPanel() {};
72 virtual void clear() = 0;
74 intf_thread_t *p_intf;
76 virtual void updateMRL() = 0;
78 void mrlUpdated( QString );
79 void methodChanged( QString method );
82 class FileOpenBox: public QFileDialog
86 FileOpenBox( QWidget *parent, const QString &caption,
87 const QString &directory, const QString &filter ):
88 QFileDialog( parent, caption, directory, filter ) {}
93 class FileOpenPanel: public OpenPanel
97 FileOpenPanel( QWidget *, intf_thread_t * );
98 virtual ~FileOpenPanel();
99 virtual void clear() ;
100 virtual void accept() ;
103 QStringList browse( QString );
104 FileOpenBox *dialogBox;
105 QLineEdit *lineFileEdit;
106 QStringList fileCompleteList ;
108 virtual void updateMRL();
110 void browseFileSub();
111 void toggleSubtitleFrame();
114 class NetOpenPanel: public OpenPanel
118 NetOpenPanel( QWidget *, intf_thread_t * );
119 virtual ~NetOpenPanel();
120 virtual void clear() ;
124 virtual void updateMRL();
126 void updateProtocol( int );
129 class DiscOpenPanel: public OpenPanel
133 DiscOpenPanel( QWidget *, intf_thread_t * );
134 virtual ~DiscOpenPanel();
135 virtual void clear() ;
136 virtual void accept() ;
139 char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath;
140 bool b_firstdvd, b_firstvcd, b_firstcdda;
142 virtual void updateMRL() ;
145 void updateButtons() ;
149 class CaptureOpenPanel: public OpenPanel
153 CaptureOpenPanel( QWidget *, intf_thread_t * );
154 virtual ~CaptureOpenPanel();
155 virtual void clear() ;
158 QRadioButton *dvbs, *dvbt, *dvbc;
159 QRadioButton *bdas, *bdat, *bdac;
160 QSpinBox *v4lFreq, *pvrFreq, *pvrBitr;
161 QLineEdit *v4lVideoDevice, *v4lAudioDevice;
162 QLineEdit *v4l2VideoDevice, *v4l2AudioDevice;
163 QLineEdit *pvrDevice, *pvrRadioDevice;
164 QComboBox *v4lNormBox, *v4l2StdBox, *pvrNormBox, *bdaBandBox;
165 QSpinBox *dvbCard, *dvbFreq, *dvbSrate;
166 QSpinBox *bdaCard, *bdaFreq, *bdaSrate;
167 QSpinBox *jackChannels, *jackCaching;
168 QCheckBox *jackPace, *jackConnect;
169 QLineEdit *jackPortsSelected;
171 QLabel *bdaSrateLabel, *bdaBandLabel;
174 virtual void updateMRL();
176 void updateButtons();