/* Connects */
BUTTONACT( ui.fileBrowseButton, browseFile() );
- BUTTONACT( ui.delFileButton, deleteFile() );
+ BUTTONACT( ui.removeFileButton, removeFile() );
BUTTONACT( ui.subBrowseButton, browseFileSub() );
CONNECT( ui.subCheckBox, toggled( bool ), this, toggleSubtitleFrame( bool ) );
CONNECT( ui.subInput, textChanged( const QString& ), this, updateMRL() );
CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this, updateMRL() );
CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this, updateMRL() );
+ updateButtons();
}
inline void FileOpenPanel::BuildOldPanel()
/* Make this QFileDialog a child of tempWidget from the ui. */
dialogBox = new FileOpenBox( ui.tempWidget, NULL,
- qfu( p_intf->p_sys->psz_filepath ), "" );
+ p_intf->p_sys->filepath, "" );
dialogBox->setFileMode( QFileDialog::ExistingFiles );
dialogBox->setAcceptMode( QFileDialog::AcceptOpen );
QStringList files = QFileDialog::getOpenFileNames( this );
foreach( const QString &file, files)
{
- QListWidgetItem *item = new QListWidgetItem( file, ui.fileListWidg );
+ QListWidgetItem *item =
+ new QListWidgetItem( toNativeSeparators( file ), ui.fileListWidg );
item->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled );
ui.fileListWidg->addItem( item );
}
+ updateButtons();
updateMRL();
}
-void FileOpenPanel::deleteFile()
+void FileOpenPanel::removeFile()
{
int i = ui.fileListWidg->currentRow();
if( i != -1 )
}
updateMRL();
+ updateButtons();
}
/* Show a fileBrowser to select a subtitle */
{
// TODO Handle selection of more than one subtitles file
QStringList files = THEDP->showSimpleOpen( qtr("Open subtitles file"),
- EXT_FILTER_SUBTITLE, p_intf->p_sys->psz_filepath );
+ EXT_FILTER_SUBTITLE, p_intf->p_sys->filepath );
if( files.isEmpty() ) return;
- ui.subInput->setText( files.join(" ") );
+ ui.subInput->setText( toNativeSeparators( files.join(" ") ) );
updateMRL();
}
/* Function called by Open Dialog when clicke on Play/Enqueue */
void FileOpenPanel::accept()
{
- //FIXME
- // p_intf->p_sys->psz_filepath = qtu( dialogBox->directory().absolutePath() );
+ p_intf->p_sys->filepath = dialogBox->directory().absolutePath();
ui.fileListWidg->clear();
}
ui.subInput->clear();
}
+/* Update buttons depending on current selection */
+void FileOpenPanel::updateButtons()
+{
+ bool b_has_files = ( ui.fileListWidg->count() > 0 );
+ ui.removeFileButton->setEnabled( b_has_files );
+ ui.subCheckBox->setEnabled( b_has_files );
+}
+
/**************************************************************************
* Open Discs ( DVD, CD, VCD and similar devices ) *
**************************************************************************/
updateMRL();
}
+#undef setDrive
+
/* Update the current MRL */
void DiscOpenPanel::updateMRL()
{
/* CDDA */
} else {
mrl = "cdda://" + ui.deviceCombo->currentText();
- if( ui.titleSpin->value() > 0 ) {
- mrl += QString(" :cdda-track=%1").arg( ui.titleSpin->value() );
- }
}
fileList << mrl; mrl = "";
QString("%1").arg( ui.subtitlesSpin->value() );
}
}
+ else
+ {
+ if( ui.titleSpin->value() > 0 )
+ mrl += QString(" :cdda-track=%1").arg( ui.titleSpin->value() );
+ }
emit mrlUpdated( fileList, mrl );
}
while( tempL.size() > 8 ) tempL.removeFirst();
getSettings()->setValue( "Open/netMRL", tempL );
+
+ delete mrlList;
}
void NetOpenPanel::clear()
ui.optionsBox->setLayout( stackedPropLayout );
/* Creation and connections of the WIdgets in the stacked layout */
-#define addModuleAndLayouts( number, name, label ) \
+#define addModuleAndLayouts( number, name, label, layout ) \
QWidget * name ## DevPage = new QWidget( this ); \
QWidget * name ## PropPage = new QWidget( this ); \
stackedDevLayout->addWidget( name ## DevPage ); \
stackedPropLayout->addWidget( name ## PropPage ); \
- QGridLayout * name ## DevLayout = new QGridLayout; \
- QGridLayout * name ## PropLayout = new QGridLayout; \
+ layout * name ## DevLayout = new layout; \
+ layout * name ## PropLayout = new layout; \
name ## DevPage->setLayout( name ## DevLayout ); \
name ## PropPage->setLayout( name ## PropLayout ); \
ui.deviceCombo->addItem( qtr( label ), QVariant( number ) );
* DirectShow Stuffs *
*********************/
if( module_exists( "dshow" ) ){
- addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow" );
+ addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow", QGridLayout );
/* dshow Main */
int line = 0;
* BDA Stuffs *
**************/
if( module_exists( "bda" ) ){
- addModuleAndLayouts( BDA_DEVICE, bda, "DVB DirectShow" );
+ addModuleAndLayouts( BDA_DEVICE, bda, "DVB DirectShow", QGridLayout );
/* bda Main */
QLabel *bdaTypeLabel = new QLabel( qtr( "DVB Type:" ) );
* V4L2*
*******/
if( module_exists( "v4l2" ) ){
- addModuleAndLayouts( V4L2_DEVICE, v4l2, "Video for Linux 2" );
+ addModuleAndLayouts( V4L2_DEVICE, v4l2, "Video for Linux 2", QGridLayout );
/* V4l Main panel */
QLabel *v4l2VideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
* V4L *
*******/
if( module_exists( "v4l" ) ){
- addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux" );
+ addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux", QGridLayout );
/* V4l Main panel */
QLabel *v4lVideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
* JACK *
*******/
if( module_exists( "jack" ) ){
- addModuleAndLayouts( JACK_DEVICE, jack, "JACK Audio Connection Kit" );
+ addModuleAndLayouts( JACK_DEVICE, jack, "JACK Audio Connection Kit",
+ QGridLayout);
/* Jack Main panel */
/* Channels */
* PVR *
************/
if( module_exists( "pvr" ) ){
- addModuleAndLayouts( PVR_DEVICE, pvr, "PVR" );
+ addModuleAndLayouts( PVR_DEVICE, pvr, "PVR", QGridLayout );
/* PVR Main panel */
QLabel *pvrDeviceLabel = new QLabel( qtr( "Device name" ) );
* DVB Stuffs *
**************/
if( module_exists( "dvb" ) ){
- addModuleAndLayouts( DVB_DEVICE, dvb, "DVB" );
+ addModuleAndLayouts( DVB_DEVICE, dvb, "DVB", QGridLayout );
/* DVB Main */
QLabel *dvbDeviceLabel = new QLabel( qtr( "Adapter card to tune" ) );
dvbFreq = new QSpinBox;
dvbFreq->setAlignment( Qt::AlignRight );
dvbFreq->setSuffix(" kHz");
+ dvbFreq->setSingleStep( 1000 );
setSpinBoxFreq( dvbFreq );
dvbPropLayout->addWidget( dvbFreq, 0, 1 );
- QLabel *dvbSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
+ dvbSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
dvbPropLayout->addWidget( dvbSrateLabel, 1, 0 );
dvbSrate = new QSpinBox;
dvbSrate->setSuffix(" kHz");
setSpinBoxFreq( dvbSrate );
dvbPropLayout->addWidget( dvbSrate, 1, 1 );
+
+ dvbBandLabel = new QLabel( qtr( "Bandwidth" ) );
+ dvbPropLayout->addWidget( dvbBandLabel, 2, 0 );
+
+ dvbBandBox = new QComboBox;
+ /* This doesn't work since dvb-bandwidth doesn't seem to be a
+ list of Integers
+ setfillVLCConfigCombo( "dvb-bandwidth", p_intf, bdaBandBox );
+ */
+ dvbBandBox->addItem( qtr( "Auto" ), 0 );
+ dvbBandBox->addItem( qtr( "6 MHz" ), 6 );
+ dvbBandBox->addItem( qtr( "7 MHz" ), 7 );
+ dvbBandBox->addItem( qtr( "8 MHz" ), 8 );
+ dvbPropLayout->addWidget( dvbBandBox, 2, 1 );
+
+ dvbBandLabel->hide();
+ dvbBandBox->hide();
+
dvbPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
2, 0, 2, 1 );
CuMRL( dvbCard, valueChanged ( int ) );
CuMRL( dvbFreq, valueChanged ( int ) );
CuMRL( dvbSrate, valueChanged ( int ) );
+ CuMRL( dvbBandBox, currentIndexChanged ( int ) );
BUTTONACT( dvbs, updateButtons() );
BUTTONACT( dvbt, updateButtons() );
BUTTONACT( dvbc, updateButtons() );
+ BUTTONACT( dvbs, updateMRL() );
+ BUTTONACT( dvbt, updateMRL() );
+ BUTTONACT( dvbc, updateMRL() );
}
#endif
/**********
* Screen *
**********/
- addModuleAndLayouts( SCREEN_DEVICE, screen, "Desktop" );
- QLabel *screenLabel = new QLabel( "Your display will will be "
- "opened and played in order to stream or save it." );
+ addModuleAndLayouts( SCREEN_DEVICE, screen, "Desktop", QGridLayout );
+ QLabel *screenLabel = new QLabel( qtr( "Your display will be "
+ "opened and played in order to stream or save it." ) );
screenLabel->setWordWrap( true );
screenDevLayout->addWidget( screenLabel, 0, 0 );
screenFPS->setAlignment( Qt::AlignRight );
screenPropLayout->addWidget( screenFPS, 0, 1 );
+ /* Screen connect */
+ CuMRL( screenFPS, valueChanged( int ) );
+
/* General connects */
CONNECT( ui.deviceCombo, activated( int ) ,
stackedDevLayout, setCurrentIndex( int ) );
CONNECT( ui.deviceCombo, activated( int ), this, updateMRL() );
CONNECT( ui.deviceCombo, activated( int ), this, updateButtons() );
-#undef addModule
+#undef CuMRL
+#undef addModuleAndLayouts
}
CaptureOpenPanel::~CaptureOpenPanel()
else if( bdac->isChecked() ) mrl = "dvb-c://";
else if( bdaa->isChecked() ) mrl = "atsc://";
else return;
+ mrl += "frequency=" + QString::number( bdaFreq->value() );
+ if( bdac->isChecked() || bdat->isChecked() || bdaa->isChecked() )
+ mrl +="000";
fileList << mrl; mrl = "";
- mrl += " :dvb-frequency=" + QString::number( bdaFreq->value() );
if( bdas->isChecked() || bdac->isChecked() )
mrl += " :dvb-srate=" + QString::number( bdaSrate->value() );
- else if( bdat->isChecked() )
+ else if( bdat->isChecked() || bdaa->isChecked() )
mrl += " :dvb-bandwidth=" +
QString::number( bdaBandBox->itemData(
bdaBandBox->currentIndex() ).toInt() );
mrl += " :pvr-bitrate=" + QString::number( pvrBitr->value() );
break;
case DVB_DEVICE:
- fileList << "dvb://";
+ mrl = "dvb://";
+ mrl += "frequency=" + QString::number( dvbFreq->value() );
+ if( dvbc->isChecked() || dvbt->isChecked() )
+ mrl +="000";
+ fileList << mrl; mrl= "";
+
mrl += " :dvb-adapter=" + QString::number( dvbCard->value() );
- mrl += " :dvb-frequency=" + QString::number( dvbFreq->value() );
- mrl += " :dvb-srate=" + QString::number( dvbSrate->value() );
+ if( dvbs->isChecked() || dvbc->isChecked() )
+ mrl += " :dvb-srate=" + QString::number( dvbSrate->value() );
+ else if( dvbt->isChecked() )
+ mrl += " :dvb-bandwidth=" +
+ QString::number( dvbBandBox->itemData(
+ dvbBandBox->currentIndex() ).toInt() );
+
break;
#endif
case SCREEN_DEVICE:
bdaBandBox->hide();
bdaBandLabel->hide();
}
- else if( bdat->isChecked() )
+ else if( bdat->isChecked() || bdaa->isChecked() )
{
bdaSrate->hide();
bdaSrateLabel->hide();
break;
#else
case DVB_DEVICE:
- if( dvbs->isChecked() ) dvbFreq->setSuffix(" kHz");
- if( dvbc->isChecked() || dvbt->isChecked() ) dvbFreq->setSuffix(" Hz");
+ if( dvbs->isChecked() || dvbc->isChecked() )
+ {
+ dvbSrate->show();
+ dvbSrateLabel->show();
+ dvbBandBox->hide();
+ dvbBandLabel->hide();
+ }
+ else if( dvbt->isChecked() )
+ {
+ dvbSrate->hide();
+ dvbSrateLabel->hide();
+ dvbBandBox->show();
+ dvbBandLabel->show();
+ }
break;
#endif
case SCREEN_DEVICE:
module_config_t *p_item = p_config + n;
ConfigControl *config = ConfigControl::createControl(
VLC_OBJECT( p_intf ), p_item, advFrame, gLayout, n );
- controls.append( config );
+ if ( config )
+ controls.append( config );
}
/* Button stuffs */
for( int i = 0; i < controls.size(); i++ )
{
ConfigControl *control = controls[i];
- if( !control )
- {
- msg_Dbg( p_intf, "This shouldn't happen, please report" );
- continue;
- }
tempMRL += (i ? " :" : ":");
updateMRL();
msg_Dbg( p_intf, "%s", qtu( advMRL ) );
}
+ for( int i = 0; i < controls.size(); i++ )
+ {
+ ConfigControl *control = controls[i];
+ delete control ;
+ }
delete adv;
module_config_free( p_config );
module_release (p_module);