Commit c5240c9a authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Open Dialog: Continue Capture tab, and implement the MRL updates. Slots...

Qt4 - Open Dialog: Continue Capture tab, and implement the MRL updates. Slots and signals should be ok. Advanced Properties are not done (any volunteer ?), and Win32 are not done either.

parent 57536677
...@@ -464,16 +464,16 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -464,16 +464,16 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
QStackedLayout *stackedPropLayout = new QStackedLayout; QStackedLayout *stackedPropLayout = new QStackedLayout;
ui.optionsBox->setLayout( stackedPropLayout ); ui.optionsBox->setLayout( stackedPropLayout );
#define addModuleAndLayouts( name, label ) \ #define addModuleAndLayouts( number, name, label ) \
QWidget * name ## DevPage = new QWidget( this ); \ QWidget * name ## DevPage = new QWidget( this ); \
QWidget * name ## PropPage = new QWidget( this ); \ QWidget * name ## PropPage = new QWidget( this ); \
stackedDevLayout->addWidget( name ## DevPage ); \ stackedDevLayout->insertWidget( number, name ## DevPage ); \
stackedPropLayout->addWidget( name ## PropPage ); \ stackedPropLayout->insertWidget( number, name ## PropPage ); \
QGridLayout * name ## DevLayout = new QGridLayout; \ QGridLayout * name ## DevLayout = new QGridLayout; \
QGridLayout * name ## PropLayout = new QGridLayout; \ QGridLayout * name ## PropLayout = new QGridLayout; \
name ## DevPage->setLayout( name ## DevLayout ); \ name ## DevPage->setLayout( name ## DevLayout ); \
name ## PropPage->setLayout( name ## PropLayout ); \ name ## PropPage->setLayout( name ## PropLayout ); \
ui.deviceCombo->addItem( qtr( label ) ); ui.deviceCombo->insertItem( number, qtr( label ) );
#define CuMRL( widget, slot ) CONNECT( widget , slot , this, updateMRL() ); #define CuMRL( widget, slot ) CONNECT( widget , slot , this, updateMRL() );
...@@ -481,24 +481,24 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -481,24 +481,24 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
* V4L * * V4L *
*******/ *******/
/* V4l Main */ /* V4l Main */
addModuleAndLayouts( v4l, "Video for Linux" ); addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux" );
QLabel *v4lVideoDeviceLabel = new QLabel( qtr( "Video device name" ) ); QLabel *v4lVideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
v4lDevLayout->addWidget( v4lVideoDeviceLabel, 0, 0 ); v4lDevLayout->addWidget( v4lVideoDeviceLabel, 0, 0 );
QLineEdit *v4lVideoDevice = new QLineEdit; v4lVideoDevice = new QLineEdit;
v4lDevLayout->addWidget( v4lVideoDevice, 0, 1 ); v4lDevLayout->addWidget( v4lVideoDevice, 0, 1 );
QLabel *v4lAudioDeviceLabel = new QLabel( qtr( "Audio device name" ) ); QLabel *v4lAudioDeviceLabel = new QLabel( qtr( "Audio device name" ) );
v4lDevLayout->addWidget( v4lAudioDeviceLabel, 1, 0 ); v4lDevLayout->addWidget( v4lAudioDeviceLabel, 1, 0 );
QLineEdit *v4lAudioDevice = new QLineEdit; v4lAudioDevice = new QLineEdit;
v4lDevLayout->addWidget( v4lAudioDevice, 1, 1 ); v4lDevLayout->addWidget( v4lAudioDevice, 1, 1 );
/* V4l Props */ /* V4l Props */
QComboBox *v4lNormBox = new QComboBox; v4lNormBox = new QComboBox;
v4lNormBox->insertItem( 3, qtr( "Automatic" ) ); v4lNormBox->insertItem( 3, qtr( "Automatic" ) );
v4lNormBox->insertItem( 0, "SECAM" ); v4lNormBox->insertItem( 0, "SECAM" );
v4lNormBox->insertItem( 1, "NTSC" ); v4lNormBox->insertItem( 1, "NTSC" );
v4lNormBox->insertItem( 2, "PAL" ); v4lNormBox->insertItem( 2, "PAL" );
QSpinBox *v4lFreq = new QSpinBox; v4lFreq = new QSpinBox;
v4lFreq->setAlignment( Qt::AlignRight ); v4lFreq->setAlignment( Qt::AlignRight );
v4lFreq->setSuffix(" kHz"); v4lFreq->setSuffix(" kHz");
...@@ -520,30 +520,34 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -520,30 +520,34 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
/************ /************
* PVR * * PVR *
************/ ************/
addModuleAndLayouts( pvr, "PVR" ); addModuleAndLayouts( PVR_DEVICE, pvr, "PVR" );
/* PVR Main */ /* PVR Main */
QLabel *pvrVideoDeviceLabel = new QLabel( qtr( "Device name" ) ); QLabel *pvrDeviceLabel = new QLabel( qtr( "Device name" ) );
pvrDevLayout->addWidget( pvrVideoDeviceLabel, 0, 0 ); pvrDevLayout->addWidget( pvrDeviceLabel, 0, 0 );
QLineEdit *pvrVideoDevice = new QLineEdit; pvrDevice = new QLineEdit;
pvrDevLayout->addWidget( pvrVideoDevice, 0, 1 ); pvrDevLayout->addWidget( pvrDevice, 0, 1 );
QLabel *pvrAudioDeviceLabel = new QLabel( qtr( "Radio device name" ) ); QLabel *pvrRadioDeviceLabel = new QLabel( qtr( "Radio device name" ) );
pvrDevLayout->addWidget( pvrAudioDeviceLabel, 1, 0 ); pvrDevLayout->addWidget( pvrRadioDeviceLabel, 1, 0 );
QLineEdit *pvrAudioDevice = new QLineEdit; pvrRadioDevice = new QLineEdit;
pvrDevLayout->addWidget( pvrAudioDevice, 1, 1 ); pvrDevLayout->addWidget( pvrRadioDevice, 1, 1 );
/* PVR props */ /* PVR props */
QComboBox *pvrNormBox = new QComboBox; pvrNormBox = new QComboBox;
pvrNormBox->insertItem( 3, qtr( "Automatic" ) ); pvrNormBox->insertItem( 3, qtr( "Automatic" ) );
pvrNormBox->insertItem( 0, "SECAM" ); pvrNormBox->insertItem( 0, "SECAM" );
pvrNormBox->insertItem( 1, "NTSC" ); pvrNormBox->insertItem( 1, "NTSC" );
pvrNormBox->insertItem( 2, "PAL" ); pvrNormBox->insertItem( 2, "PAL" );
QSpinBox *pvrFreq = new QSpinBox; pvrFreq = new QSpinBox;
pvrFreq->setAlignment( Qt::AlignRight ); pvrFreq->setAlignment( Qt::AlignRight );
pvrFreq->setSuffix(" kHz"); pvrFreq->setSuffix(" kHz");
pvrBitr = new QSpinBox;
pvrBitr->setAlignment( Qt::AlignRight );
pvrBitr->setSuffix(" kHz");
QLabel *pvrNormLabel = new QLabel( qtr( "Norm" ) ); QLabel *pvrNormLabel = new QLabel( qtr( "Norm" ) );
QLabel *pvrFreqLabel = new QLabel( qtr( "Frequency" ) ); QLabel *pvrFreqLabel = new QLabel( qtr( "Frequency" ) );
QLabel *pvrBitrLabel = new QLabel( qtr( "Bitrate" ) );
pvrPropLayout->addWidget( pvrNormLabel, 0, 0 ); pvrPropLayout->addWidget( pvrNormLabel, 0, 0 );
pvrPropLayout->addWidget( pvrNormBox, 0, 1 ); pvrPropLayout->addWidget( pvrNormBox, 0, 1 );
...@@ -551,60 +555,65 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -551,60 +555,65 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
pvrPropLayout->addWidget( pvrFreqLabel, 1, 0 ); pvrPropLayout->addWidget( pvrFreqLabel, 1, 0 );
pvrPropLayout->addWidget( pvrFreq, 1, 1 ); pvrPropLayout->addWidget( pvrFreq, 1, 1 );
pvrPropLayout->addWidget( pvrBitrLabel, 2, 0 );
pvrPropLayout->addWidget( pvrBitr, 2, 1 );
/* PVR CONNECTs */ /* PVR CONNECTs */
CuMRL( pvrVideoDevice, textChanged( QString ) ); CuMRL( pvrDevice, textChanged( QString ) );
CuMRL( pvrAudioDevice, textChanged( QString ) ); CuMRL( pvrRadioDevice, textChanged( QString ) );
CuMRL( pvrFreq, valueChanged ( int ) ); CuMRL( pvrFreq, valueChanged ( int ) );
CuMRL( pvrBitr, valueChanged ( int ) );
CuMRL( pvrNormBox, currentIndexChanged ( int ) ); CuMRL( pvrNormBox, currentIndexChanged ( int ) );
/********************* /*********************
* DirectShow Stuffs * * DirectShow Stuffs *
*********************/ *********************/
addModuleAndLayouts( dshow, "DirectShow" ); addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow" );
/************** /**************
* BDA Stuffs * * BDA Stuffs *
**************/ **************/
addModuleAndLayouts( bda, "DVB / BDA" ); addModuleAndLayouts( BDA_DEVICE, bda, "DVB / BDA" );
/************** /**************
* DVB Stuffs * * DVB Stuffs *
**************/ **************/
addModuleAndLayouts( dvb, "DVB" ); addModuleAndLayouts( DVB_DEVICE, dvb, "DVB" );
/* DVB Main */ /* DVB Main */
QLabel *dvbDeviceLabel = new QLabel( qtr( "Adapter card to tune" ) ); QLabel *dvbDeviceLabel = new QLabel( qtr( "Adapter card to tune" ) );
QLabel *dvbTyepLabel = new QLabel( qtr( "DVB Type:" ) );
QSpinBox *dvbCard = new QSpinBox; dvbCard = new QSpinBox;
dvbCard->setAlignment( Qt::AlignRight ); dvbCard->setAlignment( Qt::AlignRight );
dvbCard->setPrefix( "/dev/dvb/adapter" ); dvbCard->setPrefix( "/dev/dvb/adapter" );
dvbDevLayout->addWidget( dvbDeviceLabel, 0, 0 ); dvbDevLayout->addWidget( dvbDeviceLabel, 0, 0 );
dvbDevLayout->addWidget( dvbCard, 0, 2 ); dvbDevLayout->addWidget( dvbCard, 0, 2, 1, 2 );
dvbs = new QRadioButton( "DVB-S" ); dvbs = new QRadioButton( "DVB-S" );
dvbs->setChecked( true ); dvbs->setChecked( true );
dvbc = new QRadioButton( "DVB-C" ); dvbc = new QRadioButton( "DVB-C" );
dvbt = new QRadioButton( "DVB-T" ); dvbt = new QRadioButton( "DVB-T" );
dvbDevLayout->addWidget( dvbs, 1, 0 ); dvbDevLayout->addWidget( dvbTyepLabel, 1, 0 );
dvbDevLayout->addWidget( dvbc, 1, 1 ); dvbDevLayout->addWidget( dvbs, 1, 1 );
dvbDevLayout->addWidget( dvbt, 1, 2 ); dvbDevLayout->addWidget( dvbc, 1, 2 );
dvbDevLayout->addWidget( dvbt, 1, 3 );
/* DVB Props */ /* DVB Props */
QLabel *dvbFreqLabel = QLabel *dvbFreqLabel =
new QLabel( qtr( "Transponder/multiplex frequency" ) ); new QLabel( qtr( "Transponder/multiplex frequency" ) );
dvbFreq = new QSpinBox; dvbFreq = new QSpinBox;
dvbFreq->setAlignment( Qt::AlignRight ); dvbFreq->setAlignment( Qt::AlignRight );
//FIXME DVB-C/T uses Hz
dvbFreq->setSuffix(" kHz"); dvbFreq->setSuffix(" kHz");
dvbPropLayout->addWidget( dvbFreqLabel, 0, 0 ); dvbPropLayout->addWidget( dvbFreqLabel, 0, 0 );
dvbPropLayout->addWidget( dvbFreq, 0, 1 ); dvbPropLayout->addWidget( dvbFreq, 0, 1 );
QLabel *dvbSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) ); QLabel *dvbSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
QSpinBox *dvbSrate = new QSpinBox; dvbSrate = new QSpinBox;
dvbSrate->setAlignment( Qt::AlignRight ); dvbSrate->setAlignment( Qt::AlignRight );
dvbSrate->setSuffix(" kHz"); dvbSrate->setSuffix(" kHz");
dvbPropLayout->addWidget( dvbSrateLabel, 1, 0 ); dvbPropLayout->addWidget( dvbSrateLabel, 1, 0 );
...@@ -637,6 +646,38 @@ void CaptureOpenPanel::clear() ...@@ -637,6 +646,38 @@ void CaptureOpenPanel::clear()
void CaptureOpenPanel::updateMRL() void CaptureOpenPanel::updateMRL()
{ {
QString mrl = ""; QString mrl = "";
int i_devicetype = ui.deviceCombo->currentIndex();
switch( i_devicetype )
{
case V4L_DEVICE:
mrl = "v4l://";
mrl += " :v4l-vdev=" + v4lVideoDevice->text();
mrl += " :v4l-adev=" + v4lAudioDevice->text();
mrl += " :v4l-norm=" + QString("%1").arg( v4lNormBox->currentIndex() );
mrl += " :v4l-frequency=" + QString("%1").arg( v4lFreq->value() );
break;
case PVR_DEVICE:
mrl = "pvr://";
mrl += " :pvr-device=" + pvrDevice->text();
mrl += " :pvr-radio-device=" + pvrRadioDevice->text();
mrl += " :pvr-norm=" + QString("%1").arg( pvrNormBox->currentIndex() );
if( pvrFreq->value() )
mrl += " :pvr-frequency=" + QString("%1").arg( pvrFreq->value() );
if( pvrBitr->value() )
mrl += " :pvr-bitrate=" + QString("%1").arg( pvrBitr->value() );
break;
case DVB_DEVICE:
mrl = "dvb://";
mrl += " :dvb-adapter=" + QString("%1").arg( dvbCard->value() );
mrl += " :dvb-frequency=" + QString("%1").arg( dvbFreq->value() );
mrl += " :dvb-srate=" + QString("%1").arg( dvbSrate->value() );
break;
case BDA_DEVICE:
break;
case DSHOW_DEVICE:
break;
}
emit mrlUpdated( mrl ); emit mrlUpdated( mrl );
} }
......
...@@ -35,6 +35,12 @@ ...@@ -35,6 +35,12 @@
#include "ui/open_net.h" #include "ui/open_net.h"
#include "ui/open_capture.h" #include "ui/open_capture.h"
#define V4L_DEVICE 0x0
#define PVR_DEVICE 0x1
#define DVB_DEVICE 0x2
#define BDA_DEVICE 0x3
#define DSHOW_DEVICE 0x4
class QLineEdit; class QLineEdit;
class OpenPanel: public QWidget class OpenPanel: public QWidget
...@@ -128,10 +134,13 @@ public: ...@@ -128,10 +134,13 @@ public:
virtual void clear() ; virtual void clear() ;
private: private:
Ui::OpenCapture ui; Ui::OpenCapture ui;
QRadioButton *dvbs; QRadioButton *dvbs, *dvbt, *dvbc;
QRadioButton *dvbt; QSpinBox *v4lFreq, *pvrFreq, *pvrBitr ;
QRadioButton *dvbc; QLineEdit *v4lVideoDevice, *v4lAudioDevice;
QSpinBox *dvbFreq; QLineEdit *pvrDevice, *pvrRadioDevice;
QComboBox *v4lNormBox, *pvrNormBox;
QSpinBox *dvbCard, *dvbFreq, *dvbSrate;
public slots: public slots:
virtual void updateMRL(); virtual void updateMRL();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment