Combobox will automatically do autocompletion on the edit zone */
#define POPULATE_WITH_DEVS(ppsz_devlist, targetCombo) \
QStringList targetCombo ## StringList = QStringList(); \
- for ( int i = 0; i< sizeof(ppsz_devlist) / sizeof(*ppsz_devlist); i++ ) \
+ for ( size_t i = 0; i< sizeof(ppsz_devlist) / sizeof(*ppsz_devlist); i++ ) \
targetCombo ## StringList << QString( ppsz_devlist[ i ] ); \
targetCombo->addItems( QDir( "/dev/" )\
.entryList( targetCombo ## StringList, QDir::System )\
.replaceInStrings( QRegExp("^"), "/dev/" ) \
);
-static const char psz_devModule[][8] = { "v4l2", "pvr", DTV_PLUGIN,
+static const char psz_devModule[][8] = { "v4l2", "pvr", "dtv",
"dshow", "screen", "jack" };
/**************************************************************************
/* Subtitles */
/* Deactivate the subtitles control by default. */
ui.subFrame->setEnabled( false );
- /* Build the subs size combo box */
- setfillVLCConfigCombo( "freetype-rel-fontsize" , p_intf,
- ui.sizeSubComboBox );
- /* Build the subs align combo box */
- setfillVLCConfigCombo( "subsdec-align", p_intf, ui.alignSubComboBox );
/* Connects */
BUTTONACT( ui.fileBrowseButton, browseFile() );
CONNECT( ui.fileListWidg, itemChanged( QListWidgetItem * ), this, updateMRL() );
CONNECT( ui.subInput, textChanged( const QString& ), this, updateMRL() );
- CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this, updateMRL() );
- CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this, updateMRL() );
updateButtons();
}
/* Options */
if( ui.subCheckBox->isChecked() && !ui.subInput->text().isEmpty() ) {
mrl.append( " :sub-file=" + colon_escape( ui.subInput->text() ) );
- int align = ui.alignSubComboBox->itemData(
- ui.alignSubComboBox->currentIndex() ).toInt();
- mrl.append( " :subsdec-align=" + QString().setNum( align ) );
- int size = ui.sizeSubComboBox->itemData(
- ui.sizeSubComboBox->currentIndex() ).toInt();
- mrl.append( " :freetype-rel-fontsize=" + QString().setNum( size ) );
}
- emit mrlUpdated( fileList, mrl );
emit methodChanged( "file-caching" );
+ emit mrlUpdated( fileList, mrl );
}
/* Function called by Open Dialog when clicke on Play/Enqueue */
ui.browseDiscButton->setToolTip( qtr( I_DEVICE_TOOLTIP ));
ui.deviceCombo->setToolTip( qtr(I_DEVICE_TOOLTIP) );
+ ui.deviceCombo->setInsertPolicy( QComboBox::InsertAtTop );
+ /* CONNECTs */
+ BUTTONACT( ui.dvdRadioButton, updateButtons() );
+ BUTTONACT( ui.bdRadioButton, updateButtons() );
+ BUTTONACT( ui.vcdRadioButton, updateButtons() );
+ BUTTONACT( ui.audioCDRadioButton, updateButtons() );
+ BUTTONACT( ui.dvdsimple, updateButtons() );
+ BUTTONACT( ui.browseDiscButton, browseDevice() );
+ BUTTON_SET_ACT_I( ui.ejectButton, "", toolbar/eject, qtr( "Eject the disc" ),
+ eject() );
+
+ CONNECT( ui.deviceCombo, editTextChanged( QString ), this, updateMRL());
+ CONNECT( ui.deviceCombo, currentIndexChanged( QString ), this, updateMRL());
+ CONNECT( ui.titleSpin, valueChanged( int ), this, updateMRL());
+ CONNECT( ui.chapterSpin, valueChanged( int ), this, updateMRL());
+ CONNECT( ui.audioSpin, valueChanged( int ), this, updateMRL());
+ CONNECT( ui.subtitlesSpin, valueChanged( int ), this, updateMRL());
+
+ /* Run once the updateButtons function in order to fill correctly the comboBoxes */
+ updateButtons();
+}
+
+void DiscOpenPanel::onFocus()
+{
#ifdef WIN32 /* Disc drives probing for Windows */
wchar_t szDrives[512];
szDrives[0] = '\0';
GetVolumeInformationW( drive, psz_name, 511, NULL, NULL, NULL, NULL, 0 );
QString displayName = FromWide( drive );
- if( !EMPTY_STR(psz_name) ) {
+ if( !*psz_name ) {
displayName = displayName + " - " + FromWide( psz_name );
}
POPULATE_WITH_DEVS( ppsz_discdevices, discCombo );
#endif
- /* CONNECTs */
- BUTTONACT( ui.dvdRadioButton, updateButtons() );
- BUTTONACT( ui.vcdRadioButton, updateButtons() );
- BUTTONACT( ui.audioCDRadioButton, updateButtons() );
- BUTTONACT( ui.dvdsimple, updateButtons() );
- BUTTONACT( ui.browseDiscButton, browseDevice() );
- BUTTON_SET_ACT_I( ui.ejectButton, "", toolbar/eject, qtr( "Eject the disc" ),
- eject() );
- CONNECT( ui.deviceCombo, editTextChanged( QString ), this, updateMRL());
- CONNECT( ui.titleSpin, valueChanged( int ), this, updateMRL());
- CONNECT( ui.chapterSpin, valueChanged( int ), this, updateMRL());
- CONNECT( ui.audioSpin, valueChanged( int ), this, updateMRL());
- CONNECT( ui.subtitlesSpin, valueChanged( int ), this, updateMRL());
-
- /* Run once the updateButtons function in order to fill correctly the comboBoxes */
- updateButtons();
}
DiscOpenPanel::~DiscOpenPanel()
ui.diskOptionBox_2->show();
ui.dvdsimple->setEnabled( true );
}
+ if ( ui.bdRadioButton->isChecked() )
+ {
+ if( m_discType != BRD )
+ {
+ setDrive( psz_dvddiscpath );
+ m_discType = BRD;
+ }
+ ui.titleLabel->setText( qtr("Title") );
+ ui.chapterLabel->hide();
+ ui.chapterSpin->hide();
+ ui.diskOptionBox_2->hide();
+ ui.dvdsimple->setEnabled( true );
+ }
else if ( ui.vcdRadioButton->isChecked() )
{
if( m_discType != Vcd )
else
mrl = "dvdsimple://" LOCALHOST + discPath;
- if( !ui.dvdsimple->isChecked() )
- emit methodChanged( "dvdnav-caching" );
- else
- emit methodChanged( "dvdread-caching" );
-
if ( ui.titleSpin->value() > 0 ) {
mrl += QString("@%1").arg( ui.titleSpin->value() );
if ( ui.chapterSpin->value() > 0 ) {
mrl+= QString(":%1").arg( ui.chapterSpin->value() );
}
}
+ } else if ( ui.bdRadioButton->isChecked() ) {
+ mrl = "bluray://" LOCALHOST + discPath;
/* VCD */
} else if ( ui.vcdRadioButton->isChecked() ) {
mrl = "vcd://" LOCALHOST + discPath;
- emit methodChanged( "vcd-caching" );
- if( ui.titleSpin->value() > 0 ) {
- mrl += QString("@E%1").arg( ui.titleSpin->value() );
- }
+ if( ui.titleSpin->value() > 0 )
+ mrl += QString("@%1").arg( ui.titleSpin->value() );
/* CDDA */
} else {
mrl = "cdda://" LOCALHOST + discPath;
- emit methodChanged( "cdda-caching" );
}
+ emit methodChanged( "disc-caching" );
fileList << mrl; mrl = "";
{
QString dir = QFileDialog::getExistingDirectory( this,
qtr( I_DEVICE_TOOLTIP ) );
- if (!dir.isEmpty())
- ui.deviceCombo->setEditText( toNativeSepNoSlash( dir ) );
+ if( !dir.isEmpty() )
+ {
+ ui.deviceCombo->addItem( toNativeSepNoSlash( dir ) );
+ ui.deviceCombo->setCurrentIndex( ui.deviceCombo->findText( toNativeSepNoSlash( dir ) ) );
+ updateMRL();
+ }
updateMRL();
}
OpenPanel( _parent, _p_intf )
{
ui.setupUi( this );
+ CONNECT( ui.urlComboBox, editTextChanged( const QString& ), this, updateMRL());
- /* CONNECTs */
- CONNECT( ui.urlComboBox->lineEdit(), textChanged( const QString& ), this, updateMRL());
- CONNECT( ui.urlComboBox, currentIndexChanged( const QString& ), this, updateMRL());
-
+ /* */
if( var_InheritBool( p_intf, "qt-recentplay" ) )
{
- mrlList = new QStringListModel(
- getSettings()->value( "Open/netMRL" ).toStringList() );
- ui.urlComboBox->setModel( mrlList );
- ui.urlComboBox->clearEditText();
- CONNECT( ui.urlComboBox->lineEdit(), editingFinished(), this, updateModel() );
+ b_recentList = true;
+ ui.urlComboBox->addItems( getSettings()->value( "OpenDialog/netMRL" ).toStringList() );
+ ui.urlComboBox->setMaxCount( 10 );
}
else
- mrlList = NULL;
+ b_recentList = false;
+ /* Use a simple validator for URLs */
ui.urlComboBox->setValidator( new UrlValidator( this ) );
ui.urlComboBox->setFocus();
}
NetOpenPanel::~NetOpenPanel()
{
- if( !mrlList ) return;
-
- QStringList tempL = mrlList->stringList();
- while( tempL.size() > 8 ) tempL.removeFirst();
+ if( !b_recentList ) return;
- getSettings()->setValue( "Open/netMRL", tempL );
+ /* Create the list with the current items */
+ QStringList mrlList;
+ for( int i = 0; i < ui.urlComboBox->count(); i++ )
+ mrlList << ui.urlComboBox->itemText( i );
- delete mrlList;
+ /* Clean the list... */
+ mrlList.removeDuplicates();
+ /* ...and save the 8 last entries */
+ getSettings()->setValue( "OpenDialog/netMRL", mrlList );
}
void NetOpenPanel::clear()
-{}
+{
+ ui.urlComboBox->clear();
+}
-void NetOpenPanel::onFocus()
+void NetOpenPanel::onAccept()
{
- ui.urlComboBox->setFocus();
- ui.urlComboBox->lineEdit()->selectAll();
+ if( ui.urlComboBox->findText( ui.urlComboBox->currentText() ) == -1 )
+ ui.urlComboBox->insertItem( 0, ui.urlComboBox->currentText());
}
-static int strcmp_void( const void *k, const void *e )
+void NetOpenPanel::onFocus()
{
- return strcmp( (const char *)k, (const char *)e );
+ ui.urlComboBox->setFocus();
+ ui.urlComboBox->lineEdit()->selectAll();
}
void NetOpenPanel::updateMRL()
{
- static const struct caching_map
- {
- char proto[6];
- char caching[6];
- } schemes[] =
- { /* KEEP alphabetical order on first column!! */
- { "dccp", "rtp" },
- { "ftp", "ftp" },
- { "ftps", "ftp" },
- { "http", "http" },
- { "https", "http" },
- { "mms", "mms" },
- { "mmsh", "mms" },
- { "mmst", "mms" },
- { "mmsu", "mms" },
- { "sftp", "sftp" },
- { "smb", "smb" },
- { "rtmp", "rtmp" },
- { "rtp", "rtp" },
- { "rtsp", "rtsp" },
- { "udp", "udp" },
- };
-
QString url = ui.urlComboBox->lineEdit()->text();
- if( !url.contains( "://") )
- return; /* nothing to do this far */
- /* Match the correct item in the comboBox */
- QString proto = url.section( ':', 0, 0 );
- const struct caching_map *r = (const struct caching_map *)
- bsearch( qtu(proto), schemes, sizeof(schemes) / sizeof(schemes[0]),
- sizeof(schemes[0]), strcmp_void );
- if( r )
- emit methodChanged( qfu( r->caching ) + qfu( "-caching" ) );
+ if( url.isEmpty() )
+ return;
+
+ emit methodChanged( qfu( "network-caching" ) );
QStringList qsl;
qsl << url;
emit mrlUpdated( qsl, "" );
}
-void NetOpenPanel::updateModel()
-{
- assert( mrlList );
- QStringList tempL = mrlList->stringList();
- if( !tempL.contains( ui.urlComboBox->lineEdit()->text() ) )
- tempL.append( ui.urlComboBox->lineEdit()->text() );
- mrlList->setStringList( tempL );
-}
-
-void UrlValidator::fixup( QString& str ) const
-{
- str = str.trimmed();
-}
-
-QValidator::State UrlValidator::validate( QString& str, int& pos ) const
+QValidator::State UrlValidator::validate( QString& str, int& ) const
{
if( str.contains( ' ' ) )
return QValidator::Invalid;
return QValidator::Acceptable;
}
+void UrlValidator::fixup( QString& str ) const
+{
+ str = str.trimmed();
+}
+
/**************************************************************************
* Open Capture device ( DVB, PVR, V4L, and similar ) *
**************************************************************************/
{
if( isInitialized ) return;
- msg_Dbg( p_intf, "Initialization of Capture device panel" );
isInitialized = true;
ui.setupUi( this );
module_config_t *p_config =
config_FindConfig( VLC_OBJECT(p_intf), "dshow-vdev" );
vdevDshowW = new StringListConfigControl(
- VLC_OBJECT(p_intf), p_config, this, false, dshowDevLayout, line );
+ VLC_OBJECT(p_intf), p_config, this, dshowDevLayout, line );
line++;
p_config = config_FindConfig( VLC_OBJECT(p_intf), "dshow-adev" );
adevDshowW = new StringListConfigControl(
- VLC_OBJECT(p_intf), p_config, this, false, dshowDevLayout, line );
+ VLC_OBJECT(p_intf), p_config, this, dshowDevLayout, line );
line++;
/* dshow Properties */
CuMRL( vdevDshowW->combo, currentIndexChanged ( int ) );
CuMRL( adevDshowW->combo, currentIndexChanged ( int ) );
CuMRL( dshowVSizeLine, textChanged( const QString& ) );
+ configList << "dshow-vdev" << "dshow-adev" << "dshow-size";
}
#else /* WIN32 */
/*******
"video*"
};
- char const * const ppsz_v4ladevices[] = {
- "dsp*",
- "radio*"
- };
-
- /* V4l Main panel */
+ /* V4L2 main panel */
QLabel *v4l2VideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
v4l2DevLayout->addWidget( v4l2VideoDeviceLabel, 0, 0 );
v4l2AudioDevice = new QComboBox( this );
v4l2AudioDevice->setEditable( true );
- POPULATE_WITH_DEVS( ppsz_v4ladevices, v4l2AudioDevice );
+ {
+ QStringList patterns = QStringList();
+ patterns << QString( "pcmC*D*c" );
+
+ QStringList nodes = QDir( "/dev/snd" ).entryList( patterns,
+ QDir::System );
+ QStringList names = nodes.replaceInStrings( QRegExp("^pcmC"), "hw:" )
+ .replaceInStrings( QRegExp("c$"), "" )
+ .replaceInStrings( QRegExp("D"), "," );
+ v4l2AudioDevice->addItems( names );
+ }
v4l2AudioDevice->clearEditText();
v4l2DevLayout->addWidget( v4l2AudioDevice, 1, 1 );
CuMRL( v4l2AudioDevice->lineEdit(), textChanged( const QString& ) );
CuMRL( v4l2AudioDevice, currentIndexChanged ( int ) );
CuMRL( v4l2StdBox, currentIndexChanged ( int ) );
+ configList << "v4l2-standard" << "v4l2-dev";
}
/*******
/* Jack Props panel */
- /* 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 , 2 );
-
/* Pace */
jackPace = new QCheckBox(qtr( "Use VLC pace" ));
- jackPropLayout->addWidget( jackPace, 2, 1 );
+ jackPropLayout->addWidget( jackPace, 1, 1 );
/* Auto Connect */
jackConnect = new QCheckBox( qtr( "Auto connection" ));
- jackPropLayout->addWidget( jackConnect, 2, 2 );
+ jackPropLayout->addWidget( jackConnect, 1, 2 );
/* Jack CONNECTs */
CuMRL( jackChannels, valueChanged( int ) );
- CuMRL( jackCaching, valueChanged( int ) );
CuMRL( jackPace, stateChanged( int ) );
CuMRL( jackConnect, stateChanged( int ) );
CuMRL( jackPortsSelected, textChanged( const QString& ) );
+ configList << "jack-input-use-vlc-pace" << "jack-input-auto-connect";
}
/************
CuMRL( pvrFreq, valueChanged ( int ) );
CuMRL( pvrBitr, valueChanged ( int ) );
CuMRL( pvrNormBox, currentIndexChanged ( int ) );
+ configList << "pvr-device" << "pvr-radio-device" << "pvr-norm"
+ << "pvr-frequency" << "pvr-bitrate";
}
#endif
/*************
* DVB Stuff *
*************/
- if( module_exists( DTV_PLUGIN ) ){
+ if( module_exists( "dtv" ) ){
addModuleAndLayouts( DTV_DEVICE, dvb, N_("TV (digital)"), QGridLayout );
/* DVB Main */
dvbCard->setAlignment( Qt::AlignRight );
#ifdef __linux__
dvbCard->setPrefix( "/dev/dvb/adapter" );
- dvbFE = new QSpinBox;
- dvbFE->setPrefix( "/frontend" );
#endif
dvbDevLayout->addWidget( dvbDeviceLabel, 0, 0 );
dvbDevLayout->addWidget( dvbCard, 0, 1, 1, 2 );
-#ifdef __linux__
- dvbDevLayout->addWidget( dvbFE, 0, 3 );
-#endif
dvbc = new QRadioButton( "DVB-C" );
dvbs = new QRadioButton( "DVB-S" );
dvbs2 = new QRadioButton( "DVB-S2" );
dvbt = new QRadioButton( "DVB-T" );
+ dvbt2 = new QRadioButton( "DVB-T2" );
atsc = new QRadioButton( "ATSC" );
cqam = new QRadioButton( "Clear QAM" );
dvbt->setChecked( true );
dvbDevLayout->addWidget( dvbTypeLabel, 1, 0, 2, 1 );
- dvbDevLayout->addWidget( dvbc, 1, 1 );
- dvbDevLayout->addWidget( dvbs, 1, 2 );
+ dvbDevLayout->addWidget( dvbc, 1, 1 );
+ dvbDevLayout->addWidget( dvbs, 1, 2 );
dvbDevLayout->addWidget( dvbs2, 2, 2 );
- dvbDevLayout->addWidget( dvbt, 1, 3 );
- dvbDevLayout->addWidget( atsc, 1, 4 );
- dvbDevLayout->addWidget( cqam, 2, 4 );
+ dvbDevLayout->addWidget( dvbt, 1, 3 );
+ dvbDevLayout->addWidget( dvbt2, 2, 3 );
+ dvbDevLayout->addWidget( atsc, 1, 4 );
+ dvbDevLayout->addWidget( cqam, 2, 4 );
/* DVB Props panel */
QLabel *dvbFreqLabel =
/* DVB CONNECTs */
CuMRL( dvbCard, valueChanged ( int ) );
-#ifdef __linux__
- CuMRL( dvbFE, valueChanged ( int ) );
-#endif
CuMRL( dvbFreq, valueChanged ( int ) );
CuMRL( dvbSrate, valueChanged ( int ) );
CuMRL( dvbQamBox, currentIndexChanged ( int ) );
BUTTONACT( dvbs, updateButtons() );
BUTTONACT( dvbs2, updateButtons() );
BUTTONACT( dvbt, updateButtons() );
+ BUTTONACT( dvbt2, updateButtons() );
BUTTONACT( atsc, updateButtons() );
BUTTONACT( cqam, updateButtons() );
BUTTONACT( dvbc, updateMRL() );
BUTTONACT( dvbt, updateMRL() );
+ BUTTONACT( dvbt2, updateMRL() );
BUTTONACT( dvbs, updateMRL() );
BUTTONACT( dvbs2, updateMRL() );
BUTTONACT( atsc, updateMRL() );
BUTTONACT( cqam, updateMRL() );
+ configList << "dvb-adapter" << "dvb-frequency" << "dvb-modulation"
+ << "dvb-bandwidth";
}
/**********
colon_escape( QString("%1").arg( adevDshowW->getValue() ) )+" ";
if( dshowVSizeLine->isModified() )
mrl += ":dshow-size=" + dshowVSizeLine->text();
- emit methodChanged( "dshow-caching" );
break;
#else
case V4L2_DEVICE:
fileList << "v4l2://" + v4l2VideoDevice->currentText();
+ mrl += ":v4l2-standard="
+ + v4l2StdBox->itemData( v4l2StdBox->currentIndex() ).toString();
mrl += " :input-slave=alsa://" + v4l2AudioDevice->currentText();
- mrl += " :v4l2-standard=" + QString::number( v4l2StdBox->currentIndex() );
break;
case JACK_DEVICE:
mrl = "jack://";
mrl += ":ports=" + jackPortsSelected->text();
fileList << mrl; mrl = "";
- mrl += " :jack-input-caching=" + QString::number( jackCaching->value() );
if ( jackPace->isChecked() )
{
mrl += " :jack-input-use-vlc-pace";
else
if( dvbt->isChecked() ) mrl = "dvb-t://";
else
+ if( dvbt2->isChecked() ) mrl = "dvb-t2://";
+ else
if( atsc->isChecked() ) mrl = "atsc://";
else
if( cqam->isChecked() ) mrl = "cqam://";
- mrl += "frequency=" + QString::number( dvbFreq->value() );
+ mrl += "frequency=" + QString::number( dvbFreq->value() ) + "000";
if( dvbc->isChecked() || cqam->isChecked() )
mrl += ":modulation="
+ dvbPskBox->itemData( dvbPskBox->currentIndex() ).toString();
if( dvbc->isChecked() || dvbs->isChecked() || dvbs2->isChecked() )
mrl += ":srate=" + QString::number( dvbSrate->value() );
- if( dvbt->isChecked() )
+ if( dvbt->isChecked() || dvbt2->isChecked() )
mrl += ":bandwidth=" +
QString::number( dvbBandBox->itemData(
dvbBandBox->currentIndex() ).toInt() );
fileList << mrl; mrl= "";
mrl += " :dvb-adapter=" + QString::number( dvbCard->value() );
-#ifdef __linux__
- mrl += " :dvb-device=" + QString::number( dvbFE->value() );
-#endif
break;
case SCREEN_DEVICE:
fileList << "screen://";
mrl = " :screen-fps=" + QString::number( screenFPS->value(), 'f' );
- emit methodChanged( "screen-caching" );
updateButtons();
break;
}
+ emit methodChanged( "live-caching" );
if( !advMRL.isEmpty() ) mrl += advMRL;
dvbPskBox->show();
dvbModLabel->show();
}
- else if( dvbt->isChecked() )
+ else if( dvbt->isChecked() || dvbt2->isChecked() )
{
dvbBandBox->show();
dvbBandLabel->show();
for( int n = 0; n < (int)i_confsize; n++ )
{
module_config_t *p_item = p_config + n;
+ QString name = p_item->psz_name;
+
+ if( name.isEmpty() || configList.contains( name ) )
+ continue;
+
+ msg_Err( p_intf, "%s", p_item->psz_name);
ConfigControl *config = ConfigControl::createControl(
VLC_OBJECT( p_intf ), p_item, advFrame, gLayout, n );
- if ( config )
+ if( config )
controls.append( config );
}
if( adv->exec() )
{
QString tempMRL = "";
- for( int i = 0; i < controls.size(); i++ )
+ for( int i = 0; i < controls.count(); i++ )
{
ConfigControl *control = controls[i];
}
advMRL = tempMRL;
updateMRL();
- msg_Dbg( p_intf, "%s", qtu( advMRL ) );
- }
- for( int i = 0; i < controls.size(); i++ )
- {
- ConfigControl *control = controls[i];
- delete control ;
}
+ qDeleteAll( controls );
delete adv;
module_config_free( p_config );
- module_release (p_module);
}