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 ); }
51 #define DSHOW_DEVICE 4
52 #define SCREEN_DEVICE 5
59 class OpenPanel: public QWidget
63 OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
67 virtual ~OpenPanel() {};
68 virtual void clear() = 0;
70 intf_thread_t *p_intf;
72 virtual void updateMRL() = 0;
74 void mrlUpdated( QString );
75 void methodChanged( QString method );
78 class FileOpenBox: public QFileDialog
82 FileOpenBox( QWidget *parent, const QString &caption,
83 const QString &directory, const QString &filter ):
84 QFileDialog( parent, caption, directory, filter ) {}
89 class FileOpenPanel: public OpenPanel
93 FileOpenPanel( QWidget *, intf_thread_t * );
94 virtual ~FileOpenPanel();
95 virtual void clear() ;
96 virtual void accept() ;
99 QStringList browse( QString );
100 FileOpenBox *dialogBox;
101 QLineEdit *lineFileEdit;
103 virtual void updateMRL();
106 void browseFileSub();
107 void toggleSubtitleFrame();
110 class NetOpenPanel: public OpenPanel
114 NetOpenPanel( QWidget *, intf_thread_t * );
115 virtual ~NetOpenPanel();
116 virtual void clear() ;
120 virtual void updateMRL();
122 void updateProtocol(int);
123 void updateAddress();
126 class DiscOpenPanel: public OpenPanel
130 DiscOpenPanel( QWidget *, intf_thread_t * );
131 virtual ~DiscOpenPanel();
132 virtual void clear() ;
136 virtual void updateMRL() ;
137 virtual void updateButtons() ;
141 class CaptureOpenPanel: public OpenPanel
145 CaptureOpenPanel( QWidget *, intf_thread_t * );
146 virtual ~CaptureOpenPanel();
147 virtual void clear() ;
150 QRadioButton *dvbs, *dvbt, *dvbc;
151 QRadioButton *bdas, *bdat, *bdac;
152 QSpinBox *v4lFreq, *pvrFreq, *pvrBitr;
153 QLineEdit *v4lVideoDevice, *v4lAudioDevice;
154 QLineEdit *pvrDevice, *pvrRadioDevice;
155 QComboBox *v4lNormBox, *pvrNormBox, *bdaBandBox;
156 QSpinBox *dvbCard, *dvbFreq, *dvbSrate;
157 QSpinBox *bdaCard, *bdaFreq, *bdaSrate;
158 QSpinBox *jackChannels, *jackCaching;
159 QCheckBox *jackPace, *jackConnect;
160 QLineEdit *jackPortsSelected;
162 QLabel *bdaSrateLabel, *bdaBandLabel;
165 virtual void updateMRL();
167 void updateButtons();