X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fcomponents%2Fopen.cpp;h=d01b15f16e780bf5bad8550b927c0c328348a9e8;hb=8622fe6eb11911adc59f4abc6bbe8b7580e35899;hp=e11523bc3249a432756a6fd6b6f88bb1d94f1a88;hpb=fd549c757e6c84b641b1f5ee53c14ae14d49e17a;p=vlc diff --git a/modules/gui/qt4/components/open.cpp b/modules/gui/qt4/components/open.cpp index e11523bc32..d01b15f16e 100644 --- a/modules/gui/qt4/components/open.cpp +++ b/modules/gui/qt4/components/open.cpp @@ -2,10 +2,13 @@ * open.cpp : Panels for the open dialogs **************************************************************************** * Copyright (C) 2006-2007 the VideoLAN team + * Copyright (C) 2007 Société des arts technologiques + * Copyright (C) 2007 Savoir-faire Linux * $Id$ * * Authors: Clément Stenac * Jean-Baptiste Kempf + * Pierre-Luc Beaudoin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,12 +38,8 @@ #include #include -#ifdef HAVE_LIMITS_H -# include -#endif - /************************************************************************** - * File open + * Open Files and subtitles * **************************************************************************/ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : OpenPanel( _parent, _p_intf ) @@ -64,7 +63,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : // Make this QFileDialog a child of tempWidget from the ui. dialogBox = new FileOpenBox( ui.tempWidget, NULL, qfu( p_intf->p_libvlc->psz_homedir ), fileTypes ); -/* dialogBox->setFileMode( QFileDialog::ExistingFiles );*/ + dialogBox->setFileMode( QFileDialog::ExistingFiles ); dialogBox->setAcceptMode( QFileDialog::AcceptOpen ); /* retrieve last known path used in file browsing */ @@ -77,19 +76,25 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : /* We don't want to see a grip in the middle of the window, do we? */ dialogBox->setSizeGripEnabled( false ); - dialogBox->setToolTip( qtr( "Select one or multiple files, or a folder" )); + + /* Add a tooltip */ + dialogBox->setToolTip( qtr( "Select one or multiple files, or a folder" ) ); // Add it to the layout ui.gridLayout->addWidget( dialogBox, 0, 0, 1, 3 ); // But hide the two OK/Cancel buttons. Enable them for debug. QDialogButtonBox *fileDialogAcceptBox = - findChildren()[0]; + findChildren()[0]; fileDialogAcceptBox->hide(); /* Ugly hacks to get the good Widget */ //This lineEdit is the normal line in the fileDialog. +#if QT43 + lineFileEdit = findChildren()[2]; +#else lineFileEdit = findChildren()[3]; +#endif lineFileEdit->hide(); /* Make a list of QLabel inside the QFileDialog to access the good ones */ @@ -100,10 +105,10 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : /* Change the text that was uncool in the usual box */ listLabel[5]->setText( qtr( "Filter:" ) ); + QListView *fileListView = findChildren().first(); #if WIN32 - /* QFileDialog is quite buggy make it brerable on win32 by tweaking + /* QFileDialog is quite buggy make it brerable on win32 by tweaking the followin */ - QListView *fileListView = findChildren().first(); fileListView->setLayoutMode(QListView::Batched); fileListView->setViewMode(QListView::ListMode); fileListView->setResizeMode(QListView::Adjust); @@ -116,47 +121,28 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ui.subFrame->hide(); /* Build the subs size combo box */ - module_config_t *p_item = - config_FindConfig( VLC_OBJECT(p_intf), "freetype-rel-fontsize" ); - if( p_item ) - { - for( int i_index = 0; i_index < p_item->i_list; i_index++ ) - { - ui.sizeSubComboBox->addItem( - qfu( p_item->ppsz_list_text[i_index] ), - QVariant( p_item->pi_list[i_index] ) ); - if( p_item->value.i == p_item->pi_list[i_index] ) - { - ui.sizeSubComboBox->setCurrentIndex( i_index ); - } - } - } + setfillVLCConfigCombo( "freetype-rel-fontsize" , p_intf, + ui.sizeSubComboBox ); /* Build the subs align combo box */ - p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-align" ); - if( p_item ) - { - for( int i_index = 0; i_index < p_item->i_list; i_index++ ) - { - ui.alignSubComboBox->addItem( - qfu( p_item->ppsz_list_text[i_index] ), - QVariant( p_item->pi_list[i_index] ) ); - if( p_item->value.i == p_item->pi_list[i_index] ) - { - ui.alignSubComboBox->setCurrentIndex( i_index ); - } - } - } + setfillVLCConfigCombo( "subsdec-align", p_intf, ui.alignSubComboBox ); /* Connects */ BUTTONACT( ui.subBrowseButton, browseFileSub() ); BUTTONACT( ui.subCheckBox, toggleSubtitleFrame()); - CONNECT( ui.fileInput, editTextChanged( QString ), this, updateMRL()); - CONNECT( ui.subInput, editTextChanged( QString ), this, updateMRL()); - CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this, updateMRL()); - CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this, updateMRL()); - CONNECT( lineFileEdit, textChanged( QString ), this, browseFile()); +#if QT43 + CONNECT( fileListView, clicked( QModelIndex ), this, updateMRL() ); +#else + CONNECT( ui.fileInput, editTextChanged( QString ), this, updateMRL() ); +#endif + CONNECT( ui.subInput, editTextChanged( QString ), this, updateMRL() ); + CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this, + updateMRL() ); + CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this, + updateMRL() ); + + CONNECT( lineFileEdit, textChanged( QString ), this, browseFile() ); } FileOpenPanel::~FileOpenPanel() @@ -167,7 +153,6 @@ QStringList FileOpenPanel::browse( QString help ) return THEDP->showSimpleOpen( help ); } -/* Unused. FIXME ? */ void FileOpenPanel::browseFile() { QString fileString = ""; @@ -191,6 +176,7 @@ void FileOpenPanel::browseFileSub() void FileOpenPanel::updateMRL() { + msg_Dbg( p_intf, "I was here" ); QString mrl = ui.fileInput->currentText(); if( ui.subCheckBox->isChecked() ) { @@ -205,11 +191,11 @@ void FileOpenPanel::updateMRL() const char *psz_filepath = config_GetPsz( p_intf, "qt-filedialog-path" ); if( ( NULL == psz_filepath ) - || strcmp( psz_filepath,dialogBox->directory().absolutePath().toUtf8()) ) + || strcmp( psz_filepath, qtu( dialogBox->directory().absolutePath() )) ) { /* set dialog box current directory as last known path */ config_PutPsz( p_intf, "qt-filedialog-path", - dialogBox->directory().absolutePath().toUtf8() ); + qtu( dialogBox->directory().absolutePath() ) ); } delete psz_filepath; @@ -255,13 +241,16 @@ void FileOpenPanel::toggleSubtitleFrame() } /************************************************************************** - * Disk open + * Open Discs ( DVD, CD, VCD and similar devices ) * **************************************************************************/ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : OpenPanel( _parent, _p_intf ) { ui.setupUi( this ); + /*Win 32 Probe as in WX ? */ + + /* CONNECTs */ BUTTONACT( ui.dvdRadioButton, updateButtons()); BUTTONACT( ui.vcdRadioButton, updateButtons()); BUTTONACT( ui.audioCDRadioButton, updateButtons()); @@ -314,6 +303,8 @@ void DiscOpenPanel::updateButtons() void DiscOpenPanel::updateMRL() { QString mrl = ""; + + /* CDDAX and VCDX not implemented. FIXME ? */ /* DVD */ if( ui.dvdRadioButton->isChecked() ) { if( !ui.dvdsimple->isChecked() ) @@ -358,20 +349,20 @@ void DiscOpenPanel::updateMRL() QString("%1").arg( ui.subtitlesSpin->value() ); } } - emit mrlUpdated( mrl ); } /************************************************************************** - * Net open + * Open Network streams and URL pages * **************************************************************************/ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : OpenPanel( _parent, _p_intf ) { ui.setupUi( this ); + /* CONNECTs */ CONNECT( ui.protocolCombo, currentIndexChanged( int ), this, updateProtocol( int ) ); CONNECT( ui.portSpin, valueChanged( int ), this, updateMRL() ); @@ -409,7 +400,6 @@ void NetOpenPanel::updateProtocol( int idx ) { addr.replace( QRegExp("^.*://"), proto + "://"); ui.addressText->setText( addr ); } - updateMRL(); } @@ -468,19 +458,21 @@ void NetOpenPanel::updateMRL() { } /************************************************************************** - * Capture open + * Open Capture device ( DVB, PVR, V4L, and similar ) * **************************************************************************/ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : OpenPanel( _parent, _p_intf ) { ui.setupUi( this ); + /* Create two stacked layouts in the main comboBoxes */ QStackedLayout *stackedDevLayout = new QStackedLayout; ui.cardBox->setLayout( stackedDevLayout ); QStackedLayout *stackedPropLayout = new QStackedLayout; ui.optionsBox->setLayout( stackedPropLayout ); + /* Creation and connections of the WIdgets in the stacked layout */ #define addModuleAndLayouts( number, name, label ) \ QWidget * name ## DevPage = new QWidget( this ); \ QWidget * name ## PropPage = new QWidget( this ); \ @@ -494,40 +486,39 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : #define CuMRL( widget, slot ) CONNECT( widget , slot , this, updateMRL() ); -#define setMaxBound( spinbox ) spinbox->setRange ( 0, INT_MAX ); - /******* * V4L * *******/ - /* V4l Main */ addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux" ); + + /* V4l Main panel */ QLabel *v4lVideoDeviceLabel = new QLabel( qtr( "Video device name" ) ); v4lDevLayout->addWidget( v4lVideoDeviceLabel, 0, 0 ); + v4lVideoDevice = new QLineEdit; v4lDevLayout->addWidget( v4lVideoDevice, 0, 1 ); + QLabel *v4lAudioDeviceLabel = new QLabel( qtr( "Audio device name" ) ); v4lDevLayout->addWidget( v4lAudioDeviceLabel, 1, 0 ); + v4lAudioDevice = new QLineEdit; v4lDevLayout->addWidget( v4lAudioDevice, 1, 1 ); - /* V4l Props */ - v4lNormBox = new QComboBox; - v4lNormBox->insertItem( 3, qtr( "Automatic" ) ); - v4lNormBox->insertItem( 0, "SECAM" ); - v4lNormBox->insertItem( 1, "NTSC" ); - v4lNormBox->insertItem( 2, "PAL" ); - - v4lFreq = new QSpinBox; - v4lFreq->setAlignment( Qt::AlignRight ); - v4lFreq->setSuffix(" kHz"); - + /* V4l Props panel */ QLabel *v4lNormLabel = new QLabel( qtr( "Norm" ) ); - QLabel *v4lFreqLabel = new QLabel( qtr( "Frequency" ) ); - v4lPropLayout->addWidget( v4lNormLabel, 0 , 0 ); + + v4lNormBox = new QComboBox; + setfillVLCConfigCombo( "v4l-norm", p_intf, v4lNormBox ); v4lPropLayout->addWidget( v4lNormBox, 0 , 1 ); + QLabel *v4lFreqLabel = new QLabel( qtr( "Frequency" ) ); v4lPropLayout->addWidget( v4lFreqLabel, 1 , 0 ); + + v4lFreq = new QSpinBox; + v4lFreq->setAlignment( Qt::AlignRight ); + v4lFreq->setSuffix(" kHz"); + setSpinBoxFreq( v4lFreq ); v4lPropLayout->addWidget( v4lFreq, 1 , 1 ); /* v4l CONNECTs */ @@ -536,47 +527,100 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : CuMRL( v4lFreq, valueChanged ( int ) ); CuMRL( v4lNormBox, currentIndexChanged ( int ) ); + /******* + * JACK * + *******/ + addModuleAndLayouts( JACK_DEVICE, jack, "JACK Audio Connection Kit" ); + + /* Jack Main panel */ + /* Channels */ + QLabel *jackChannelsLabel = new QLabel( qtr( "Channels :" ) ); + jackDevLayout->addWidget( jackChannelsLabel, 1, 0 ); + + jackChannels = new QSpinBox; + setSpinBoxFreq( jackChannels ); + jackChannels->setMaximum(255); + jackChannels->setValue(2); + jackChannels->setAlignment( Qt::AlignRight ); + jackDevLayout->addWidget( jackChannels, 1, 1 ); + + /* Jack Props panel */ + + /* Selected ports */ + QLabel *jackPortsLabel = new QLabel( qtr( "Selected ports :" ) ); + jackPropLayout->addWidget( jackPortsLabel, 0 , 0 ); + + jackPortsSelected = new QLineEdit( qtr( ".*") ); + jackPortsSelected->setAlignment( Qt::AlignRight ); + jackPropLayout->addWidget( jackPortsSelected, 0, 1 ); + + /* Caching */ + QLabel *jackCachingLabel = new QLabel( qtr( "Input caching :" ) ); + jackPropLayout->addWidget( jackCachingLabel, 1 , 0 ); + jackCaching = new QSpinBox; + setSpinBoxFreq( jackCaching ); + jackCaching->setSuffix( " ms" ); + jackCaching->setValue(1000); + jackCaching->setAlignment( Qt::AlignRight ); + jackPropLayout->addWidget( jackCaching, 1 , 1 ); + + /* Pace */ + jackPace = new QCheckBox(qtr( "Use VLC pace" )); + jackPropLayout->addWidget( jackPace, 2, 1 ); + + /* Auto Connect */ + jackConnect = new QCheckBox( qtr( "Auto connnection" )); + jackPropLayout->addWidget( jackConnect, 3, 1 ); + + /* Jack CONNECTs */ + CuMRL( jackChannels, valueChanged( int ) ); + CuMRL( jackCaching, valueChanged( int ) ); + CuMRL( jackPace, stateChanged( int ) ); + CuMRL( jackConnect, stateChanged( int ) ); + CuMRL( jackPortsSelected, textChanged( QString ) ); + /************ * PVR * ************/ addModuleAndLayouts( PVR_DEVICE, pvr, "PVR" ); - /* PVR Main */ + /* PVR Main panel */ QLabel *pvrDeviceLabel = new QLabel( qtr( "Device name" ) ); pvrDevLayout->addWidget( pvrDeviceLabel, 0, 0 ); + pvrDevice = new QLineEdit; pvrDevLayout->addWidget( pvrDevice, 0, 1 ); + QLabel *pvrRadioDeviceLabel = new QLabel( qtr( "Radio device name" ) ); pvrDevLayout->addWidget( pvrRadioDeviceLabel, 1, 0 ); + pvrRadioDevice = new QLineEdit; pvrDevLayout->addWidget( pvrRadioDevice, 1, 1 ); - /* PVR props */ - pvrNormBox = new QComboBox; - pvrNormBox->insertItem( 3, qtr( "Automatic" ) ); - pvrNormBox->insertItem( 0, "SECAM" ); - pvrNormBox->insertItem( 1, "NTSC" ); - pvrNormBox->insertItem( 2, "PAL" ); - - pvrFreq = new QSpinBox; - pvrFreq->setAlignment( Qt::AlignRight ); - pvrFreq->setSuffix(" kHz"); - setMaxBound( pvrFreq ); - pvrBitr = new QSpinBox; - pvrBitr->setAlignment( Qt::AlignRight ); - pvrBitr->setSuffix(" kHz"); - setMaxBound( pvrBitr ); + /* PVR props panel */ QLabel *pvrNormLabel = new QLabel( qtr( "Norm" ) ); - QLabel *pvrFreqLabel = new QLabel( qtr( "Frequency" ) ); - QLabel *pvrBitrLabel = new QLabel( qtr( "Bitrate" ) ); - pvrPropLayout->addWidget( pvrNormLabel, 0, 0 ); + + pvrNormBox = new QComboBox; + setfillVLCConfigCombo( "pvr-norm", p_intf, pvrNormBox ); pvrPropLayout->addWidget( pvrNormBox, 0, 1 ); + QLabel *pvrFreqLabel = new QLabel( qtr( "Frequency" ) ); pvrPropLayout->addWidget( pvrFreqLabel, 1, 0 ); + + pvrFreq = new QSpinBox; + pvrFreq->setAlignment( Qt::AlignRight ); + pvrFreq->setSuffix(" kHz"); + setSpinBoxFreq( pvrFreq ); pvrPropLayout->addWidget( pvrFreq, 1, 1 ); + QLabel *pvrBitrLabel = new QLabel( qtr( "Bitrate" ) ); pvrPropLayout->addWidget( pvrBitrLabel, 2, 0 ); + + pvrBitr = new QSpinBox; + pvrBitr->setAlignment( Qt::AlignRight ); + pvrBitr->setSuffix(" kHz"); + setSpinBoxFreq( pvrBitr ); pvrPropLayout->addWidget( pvrBitr, 2, 1 ); /* PVR CONNECTs */ @@ -592,6 +636,44 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : *********************/ addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow" ); + /* dshow Main */ + + QLabel *dshowVDeviceLabel = new QLabel( qtr( "Video Device Name " ) ); + dshowDevLayout->addWidget( dshowVDeviceLabel, 0, 0 ); + + QLabel *dshowADeviceLabel = new QLabel( qtr( "Audio Device Name " ) ); + dshowDevLayout->addWidget( dshowADeviceLabel, 1, 0 ); + + QComboBox *dshowVDevice = new QComboBox; + dshowDevLayout->addWidget( dshowVDevice, 0, 1 ); + + QComboBox *dshowADevice = new QComboBox; + dshowDevLayout->addWidget( dshowADevice, 1, 1 ); + + QPushButton *dshowVRefresh = new QPushButton( qtr( "Update List" ) ); + dshowDevLayout->addWidget( dshowVRefresh, 0, 2 ); + + QPushButton *dshowARefresh = new QPushButton( qtr( "Update List" ) ); + dshowDevLayout->addWidget( dshowARefresh, 1, 2 ); + + QPushButton *dshowVConfig = new QPushButton( qtr( "Configure" ) ); + dshowDevLayout->addWidget( dshowVConfig, 0, 3 ); + + QPushButton *dshowAConfig = new QPushButton( qtr( "Configure" ) ); + dshowDevLayout->addWidget( dshowAConfig, 1, 3 ); + + /* dshow Properties */ + + QLabel *dshowVSizeLabel = new QLabel( qtr( "Video size" ) ); + dshowPropLayout->addWidget( dshowVSizeLabel, 0, 0 ); + + QLineEdit *dshowVSizeLine = new QLineEdit; + dshowPropLayout->addWidget( dshowVSizeLine, 0, 1); + + /* dshow CONNECTs */ + CuMRL( dshowVDevice, currentIndexChanged ( int ) ); + CuMRL( dshowADevice, currentIndexChanged ( int ) ); + CuMRL( dshowVSizeLine, textChanged( QString ) ); /************** * BDA Stuffs * @@ -606,32 +688,46 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : bdac = new QRadioButton( "DVB-C" ); bdat = new QRadioButton( "DVB-T" ); - bdaDevLayout->addWidget( bdaTypeLabel, 1, 0 ); - bdaDevLayout->addWidget( bdas, 1, 1 ); - bdaDevLayout->addWidget( bdac, 1, 2 ); - bdaDevLayout->addWidget( bdat, 1, 3 ); + bdaDevLayout->addWidget( bdaTypeLabel, 0, 0 ); + bdaDevLayout->addWidget( bdas, 0, 1 ); + bdaDevLayout->addWidget( bdac, 0, 2 ); + bdaDevLayout->addWidget( bdat, 0, 3 ); /* bda Props */ QLabel *bdaFreqLabel = new QLabel( qtr( "Transponder/multiplex frequency" ) ); + bdaPropLayout->addWidget( bdaFreqLabel, 0, 0 ); + bdaFreq = new QSpinBox; bdaFreq->setAlignment( Qt::AlignRight ); bdaFreq->setSuffix(" kHz"); - setMaxBound( bdaFreq ) - bdaPropLayout->addWidget( bdaFreqLabel, 0, 0 ); + bdaFreq->setSingleStep( 1000 ); + setSpinBoxFreq( bdaFreq ) bdaPropLayout->addWidget( bdaFreq, 0, 1 ); bdaSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) ); + bdaPropLayout->addWidget( bdaSrateLabel, 1, 0 ); + bdaSrate = new QSpinBox; bdaSrate->setAlignment( Qt::AlignRight ); bdaSrate->setSuffix(" kHz"); - setMaxBound( bdaSrate ); - bdaPropLayout->addWidget( bdaSrateLabel, 1, 0 ); + setSpinBoxFreq( bdaSrate ); bdaPropLayout->addWidget( bdaSrate, 1, 1 ); + bdaBandLabel = new QLabel( qtr( "Bandwidth" ) ); + bdaPropLayout->addWidget( bdaBandLabel, 2, 0 ); + + bdaBandBox = new QComboBox; + setfillVLCConfigCombo( "dvb-bandwidth", p_intf, bdaBandBox ); + bdaPropLayout->addWidget( bdaBandBox, 2, 1 ); + + bdaBandLabel->hide(); + bdaBandBox->hide(); + /* bda CONNECTs */ CuMRL( bdaFreq, valueChanged ( int ) ); CuMRL( bdaSrate, valueChanged ( int ) ); + CuMRL( bdaBandBox, currentIndexChanged ( int ) ); BUTTONACT( bdas, updateButtons() ); BUTTONACT( bdat, updateButtons() ); BUTTONACT( bdac, updateButtons() ); @@ -665,38 +761,53 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : dvbDevLayout->addWidget( dvbc, 1, 2 ); dvbDevLayout->addWidget( dvbt, 1, 3 ); - /* DVB Props */ + /* DVB Props panel */ QLabel *dvbFreqLabel = new QLabel( qtr( "Transponder/multiplex frequency" ) ); + dvbPropLayout->addWidget( dvbFreqLabel, 0, 0 ); + dvbFreq = new QSpinBox; dvbFreq->setAlignment( Qt::AlignRight ); dvbFreq->setSuffix(" kHz"); - setMaxBound( dvbFreq ); - dvbPropLayout->addWidget( dvbFreqLabel, 0, 0 ); + setSpinBoxFreq( dvbFreq ); dvbPropLayout->addWidget( dvbFreq, 0, 1 ); QLabel *dvbSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) ); + dvbPropLayout->addWidget( dvbSrateLabel, 1, 0 ); + dvbSrate = new QSpinBox; dvbSrate->setAlignment( Qt::AlignRight ); dvbSrate->setSuffix(" kHz"); - setMaxBound( dvbSrate ); - dvbPropLayout->addWidget( dvbSrateLabel, 1, 0 ); + setSpinBoxFreq( dvbSrate ); dvbPropLayout->addWidget( dvbSrate, 1, 1 ); /* DVB CONNECTs */ CuMRL( dvbCard, valueChanged ( int ) ); CuMRL( dvbFreq, valueChanged ( int ) ); CuMRL( dvbSrate, valueChanged ( int ) ); + BUTTONACT( dvbs, updateButtons() ); BUTTONACT( dvbt, updateButtons() ); BUTTONACT( dvbc, updateButtons() ); + /********** + * Screen * + **********/ + + addModuleAndLayouts( SCREEN_DEVICE, screen, "Desktop" ); + QLabel *screenLabel = new QLabel( "This option will open your own " + "desktop in order to save or stream it."); + screenLabel->setWordWrap( true ); + screenDevLayout->addWidget( screenLabel, 0, 0 ); + + /* General connects */ connect( ui.deviceCombo, SIGNAL( activated( int ) ), stackedDevLayout, SLOT( setCurrentIndex( int ) ) ); connect( ui.deviceCombo, SIGNAL( activated( int ) ), stackedPropLayout, SLOT( setCurrentIndex( int ) ) ); CONNECT( ui.deviceCombo, activated( int ), this, updateMRL() ); + CONNECT( ui.deviceCombo, activated( int ), this, updateButtons() ); #undef addModule } @@ -722,6 +833,20 @@ void CaptureOpenPanel::updateMRL() mrl += " :v4l-norm=" + QString("%1").arg( v4lNormBox->currentIndex() ); mrl += " :v4l-frequency=" + QString("%1").arg( v4lFreq->value() ); break; + case JACK_DEVICE: + mrl = "jack://"; + mrl += "channels=" + QString("%1").arg( jackChannels->value() ); + mrl += ":ports=" + jackPortsSelected->text(); + mrl += " --jack-input-caching=" + QString("%1").arg( jackCaching->value() ); + if ( jackPace->isChecked() ) + { + mrl += " --jack-input-use-vlc-pace"; + } + if ( jackConnect->isChecked() ) + { + mrl += " --jack-input-auto-connect"; + } + break; case PVR_DEVICE: mrl = "pvr://"; mrl += " :pvr-device=" + pvrDevice->text(); @@ -746,18 +871,34 @@ void CaptureOpenPanel::updateMRL() mrl += " :dvb-frequency=" + QString("%1").arg( bdaFreq->value() ); if( bdas->isChecked() || bdac->isChecked() ) mrl += " :dvb-srate=" + QString("%1").arg( bdaSrate->value() ); + else + mrl += " :dvb-bandwidth=" + + QString("%1").arg( bdaBandBox->itemData( + bdaBandBox->currentIndex() ).toInt() ); + break; + case DSHOW_DEVICE: break; - case DSHOW_DEVICE: + case SCREEN_DEVICE: + mrl = "screen://"; + updateButtons(); break; } - emit mrlUpdated( mrl ); } +/** + * Update the Buttons (show/hide) for the GUI as all device type don't + * use the same ui. elements. + **/ void CaptureOpenPanel::updateButtons() { + /* Be sure to display the ui Elements in case they were hidden by + * some Device Type (like Screen://) */ + ui.optionsBox->show(); + ui.advancedButton->show(); + /* Get the current Device Number */ int i_devicetype = ui.deviceCombo->itemData( - ui.deviceCombo->currentIndex() ).toInt(); + ui.deviceCombo->currentIndex() ).toInt(); msg_Dbg( p_intf, "Capture Type: %i", i_devicetype ); switch( i_devicetype ) { @@ -770,12 +911,20 @@ void CaptureOpenPanel::updateButtons() { bdaSrate->show(); bdaSrateLabel->show(); + bdaBandBox->hide(); + bdaBandLabel->hide(); } else { bdaSrate->hide(); bdaSrateLabel->hide(); + bdaBandBox->show(); + bdaBandLabel->show(); } break; + case SCREEN_DEVICE: + ui.optionsBox->hide(); + ui.advancedButton->hide(); + break; } }