00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _OPENPANELS_H_
00029 #define _OPENPANELS_H_
00030
00031 #ifdef HAVE_CONFIG_H
00032 # include "config.h"
00033 #endif
00034
00035 #include <vlc_common.h>
00036
00037 #include <QFileDialog>
00038
00039 #include "ui/open_file.h"
00040 #include "ui/open_disk.h"
00041 #include "ui/open_net.h"
00042 #include "ui/open_capture.h"
00043
00044 #include "components/preferences_widgets.hpp"
00045
00046 #include <limits.h>
00047
00048 #define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \
00049 spinbox->setAccelerated( true ); }
00050
00051 enum
00052 {
00053 NO_PROTO,
00054 HTTP_PROTO,
00055 HTTPS_PROTO,
00056 MMS_PROTO,
00057 FTP_PROTO,
00058 RTSP_PROTO,
00059 RTP_PROTO,
00060 UDP_PROTO,
00061 RTMP_PROTO
00062 };
00063
00064
00065 enum
00066 {
00067 V4L_DEVICE,
00068 V4L2_DEVICE,
00069 PVR_DEVICE,
00070 DVB_DEVICE,
00071 BDA_DEVICE,
00072 DSHOW_DEVICE,
00073 SCREEN_DEVICE,
00074 JACK_DEVICE
00075 };
00076
00077 static const char *psz_devModule[] = { "v4l", "v4l2", "pvr", "dvb", "bda",
00078 "dshow", "screen", "jack" };
00079
00080
00081 class QWidget;
00082 class QLineEdit;
00083 class QString;
00084
00085 class OpenPanel: public QWidget
00086 {
00087 Q_OBJECT;
00088 public:
00089 OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
00090 {
00091 p_intf = _p_intf;
00092 }
00093 virtual ~OpenPanel() {};
00094 virtual void clear() = 0;
00095 protected:
00096 intf_thread_t *p_intf;
00097 public slots:
00098 virtual void updateMRL() = 0;
00099 signals:
00100 void mrlUpdated( QString );
00101 void methodChanged( QString method );
00102 };
00103
00104 class FileOpenBox: public QFileDialog
00105 {
00106 Q_OBJECT;
00107 public:
00108 FileOpenBox( QWidget *parent, const QString &caption,
00109 const QString &directory, const QString &filter ):
00110 QFileDialog( parent, caption, directory, filter ) {}
00111 public slots:
00112 void accept();
00113 };
00114
00115 class FileOpenPanel: public OpenPanel
00116 {
00117 Q_OBJECT;
00118 public:
00119 FileOpenPanel( QWidget *, intf_thread_t * );
00120 virtual ~FileOpenPanel();
00121 virtual void clear() ;
00122 virtual void accept() ;
00123 private:
00124 Ui::OpenFile ui;
00125 QStringList browse( QString );
00126 FileOpenBox *dialogBox;
00127 QLineEdit *lineFileEdit;
00128 QStringList fileCompleteList ;
00129 public slots:
00130 virtual void updateMRL();
00131 private slots:
00132 void browseFileSub();
00133 void toggleSubtitleFrame();
00134 };
00135
00136 class NetOpenPanel: public OpenPanel
00137 {
00138 Q_OBJECT;
00139 public:
00140 NetOpenPanel( QWidget *, intf_thread_t * );
00141 virtual ~NetOpenPanel();
00142 virtual void clear() ;
00143 private:
00144 Ui::OpenNetwork ui;
00145 public slots:
00146 virtual void updateMRL();
00147 private slots:
00148 void updateProtocol( int );
00149 };
00150
00151 class DiscOpenPanel: public OpenPanel
00152 {
00153 Q_OBJECT;
00154 public:
00155 DiscOpenPanel( QWidget *, intf_thread_t * );
00156 virtual ~DiscOpenPanel();
00157 virtual void clear() ;
00158 virtual void accept() ;
00159 private:
00160 Ui::OpenDisk ui;
00161 char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath;
00162 bool b_firstdvd, b_firstvcd, b_firstcdda;
00163 public slots:
00164 virtual void updateMRL() ;
00165 private slots:
00166 void browseDevice();
00167 void updateButtons() ;
00168 void eject();
00169 };
00170
00171
00172 class CaptureOpenPanel: public OpenPanel
00173 {
00174 Q_OBJECT;
00175 public:
00176 CaptureOpenPanel( QWidget *, intf_thread_t * );
00177 virtual ~CaptureOpenPanel();
00178 virtual void clear() ;
00179 private:
00180 Ui::OpenCapture ui;
00181 QString advMRL;
00182 QDialog *adv;
00183 #ifdef WIN32
00184 QRadioButton *bdas, *bdat, *bdac;
00185 QSpinBox *bdaCard, *bdaFreq, *bdaSrate;
00186 QLabel *bdaSrateLabel, *bdaBandLabel;
00187 QComboBox *bdaBandBox;
00188 StringListConfigControl *vdevDshowW, *adevDshowW;
00189 QLineEdit *dshowVSizeLine;
00190 #else
00191 QRadioButton *dvbs, *dvbt, *dvbc;
00192 QSpinBox *v4lFreq, *pvrFreq, *pvrBitr;
00193 QLineEdit *v4lVideoDevice, *v4lAudioDevice;
00194 QLineEdit *v4l2VideoDevice, *v4l2AudioDevice;
00195 QLineEdit *pvrDevice, *pvrRadioDevice;
00196 QComboBox *v4lNormBox, *v4l2StdBox, *pvrNormBox;
00197 QSpinBox *dvbCard, *dvbFreq, *dvbSrate;
00198 QSpinBox *jackChannels, *jackCaching;
00199 QCheckBox *jackPace, *jackConnect;
00200 QLineEdit *jackPortsSelected;
00201 #endif
00202
00203 public slots:
00204 virtual void updateMRL();
00205 private slots:
00206 void updateButtons();
00207 void advancedDialog();
00208 };
00209
00210 #endif