1 /*****************************************************************************
2 * open.hpp : Panels for the open dialogs
3 ****************************************************************************
4 * Copyright (C) 2006-2007 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Baptiste Kempf <jb@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef _OPENPANELS_H_
26 #define _OPENPANELS_H_
30 #include <QFileDialog>
32 #include "ui/open_file.h"
33 #include "ui/open_disk.h"
34 #include "ui/open_net.h"
35 #include "ui/open_capture.h"
41 #define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \
42 spinbox->setAccelerated( true ); }
44 #define V4L_DEVICE 0x0
45 #define PVR_DEVICE 0x1
46 #define DVB_DEVICE 0x2
47 #define BDA_DEVICE 0x4
48 #define DSHOW_DEVICE 0x8
49 #define SCREEN_DEVICE 0x16
55 class OpenPanel: public QWidget
59 OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
63 virtual ~OpenPanel() {};
64 virtual void clear() = 0;
66 intf_thread_t *p_intf;
68 virtual void updateMRL() = 0;
70 void mrlUpdated( QString );
71 void methodChanged( QString method );
74 class FileOpenBox: public QFileDialog
78 FileOpenBox( QWidget *parent, const QString &caption,
79 const QString &directory, const QString &filter ):
80 QFileDialog( parent, caption, directory, filter ) {}
85 class FileOpenPanel: public OpenPanel
89 FileOpenPanel( QWidget *, intf_thread_t * );
90 virtual ~FileOpenPanel();
91 virtual void clear() ;
92 virtual void accept() ;
95 QStringList browse( QString );
96 FileOpenBox *dialogBox;
97 QLineEdit *lineFileEdit;
99 virtual void updateMRL();
102 void browseFileSub();
103 void toggleSubtitleFrame();
106 class NetOpenPanel: public OpenPanel
110 NetOpenPanel( QWidget *, intf_thread_t * );
111 virtual ~NetOpenPanel();
112 virtual void clear() ;
116 virtual void updateMRL();
118 void updateProtocol(int);
119 void updateAddress();
122 class DiscOpenPanel: public OpenPanel
126 DiscOpenPanel( QWidget *, intf_thread_t * );
127 virtual ~DiscOpenPanel();
128 virtual void clear() ;
132 virtual void updateMRL() ;
133 virtual void updateButtons() ;
137 class CaptureOpenPanel: public OpenPanel
141 CaptureOpenPanel( QWidget *, intf_thread_t * );
142 virtual ~CaptureOpenPanel();
143 virtual void clear() ;
146 QRadioButton *dvbs, *dvbt, *dvbc;
147 QRadioButton *bdas, *bdat, *bdac;
148 QSpinBox *v4lFreq, *pvrFreq, *pvrBitr ;
149 QLineEdit *v4lVideoDevice, *v4lAudioDevice;
150 QLineEdit *pvrDevice, *pvrRadioDevice;
151 QComboBox *v4lNormBox, *pvrNormBox, *bdaBandBox;
152 QSpinBox *dvbCard, *dvbFreq, *dvbSrate;
153 QSpinBox *bdaCard, *bdaFreq, *bdaSrate;
155 QLabel *bdaSrateLabel, *bdaBandLabel;
158 virtual void updateMRL();
160 void updateButtons();