]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/open_panels.cpp
Missing item to translate.
[vlc] / modules / gui / qt4 / components / open_panels.cpp
1 /*****************************************************************************
2  * open.cpp : Panels for the open dialogs
3  ****************************************************************************
4  * Copyright (C) 2006-2008 the VideoLAN team
5  * Copyright (C) 2007 Société des arts technologiques
6  * Copyright (C) 2007 Savoir-faire Linux
7  *
8  * $Id$
9  *
10  * Authors: Clément Stenac <zorglub@videolan.org>
11  *          Jean-Baptiste Kempf <jb@videolan.org>
12  *          Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
27  *****************************************************************************/
28
29 #ifdef HAVE_CONFIG_H
30 # include "config.h"
31 #endif
32
33 #include "qt4.hpp"
34 #include "components/open_panels.hpp"
35 #include "dialogs/open.hpp"
36 #include "dialogs_provider.hpp"
37
38 #include <QFileDialog>
39 #include <QDialogButtonBox>
40 #include <QLineEdit>
41 #include <QStackedLayout>
42 #include <QListView>
43 #include <QCompleter>
44 #include <QDirModel>
45 #include <QScrollArea>
46 #include <QUrl>
47
48 #define I_DEVICE_TOOLTIP N_("Select the device or the VIDEO_TS directory")
49
50 /**************************************************************************
51  * Open Files and subtitles                                               *
52  **************************************************************************/
53 FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
54                                 OpenPanel( _parent, _p_intf )
55 {
56     /* Classic UI Setup */
57     ui.setupUi( this );
58
59     /** BEGIN QFileDialog tweaking **/
60     /* Use a QFileDialog and customize it because we don't want to
61        rewrite it all. Be careful to your eyes cause there are a few hacks.
62        Be very careful and test correctly when you modify this. */
63
64     /* Set Filters for file selection */
65     QString fileTypes = "";
66     ADD_FILTER_MEDIA( fileTypes );
67     ADD_FILTER_VIDEO( fileTypes );
68     ADD_FILTER_AUDIO( fileTypes );
69     ADD_FILTER_PLAYLIST( fileTypes );
70     ADD_FILTER_ALL( fileTypes );
71     fileTypes.replace( QString(";*"), QString(" *"));
72
73     // Make this QFileDialog a child of tempWidget from the ui.
74     dialogBox = new FileOpenBox( ui.tempWidget, NULL,
75             qfu( p_intf->p_sys->psz_filepath ), fileTypes );
76
77     dialogBox->setFileMode( QFileDialog::ExistingFiles );
78     dialogBox->setAcceptMode( QFileDialog::AcceptOpen );
79 #if HAS_QT43
80     dialogBox->restoreState(
81             getSettings()->value( "file-dialog-state" ).toByteArray() );
82 #endif
83
84     /* We don't want to see a grip in the middle of the window, do we? */
85     dialogBox->setSizeGripEnabled( false );
86
87     /* Add a tooltip */
88     dialogBox->setToolTip( qtr( "Select one or multiple files" ) );
89
90     // But hide the two OK/Cancel buttons. Enable them for debug.
91     QDialogButtonBox *fileDialogAcceptBox =
92                       dialogBox->findChildren<QDialogButtonBox*>()[0];
93     fileDialogAcceptBox->hide();
94
95     /* Ugly hacks to get the good Widget */
96     //This lineEdit is the normal line in the fileDialog.
97 #if HAS_QT43
98     lineFileEdit = dialogBox->findChildren<QLineEdit*>()[0];
99 #else
100     lineFileEdit = dialogBox->findChildren<QLineEdit*>()[1];
101 #endif
102     /* Make a list of QLabel inside the QFileDialog to access the good ones */
103     QList<QLabel *> listLabel = dialogBox->findChildren<QLabel*>();
104
105     /* Hide the FileNames one. Enable it for debug */
106     listLabel[1]->setText( qtr( "File names:" ) );
107     /* Change the text that was uncool in the usual box */
108     listLabel[2]->setText( qtr( "Filter:" ) );
109
110     dialogBox->layout()->setMargin( 0 );
111     dialogBox->layout()->setSizeConstraint( QLayout::SetNoConstraint );
112
113     /** END of QFileDialog tweaking **/
114
115     // Add the DialogBox to the layout
116     ui.gridLayout->addWidget( dialogBox, 0, 0, 1, 3 );
117
118     //TODO later: fill the fileCompleteList with previous items played.
119     QCompleter *fileCompleter = new QCompleter( fileCompleteList, this );
120     fileCompleter->setModel( new QDirModel( fileCompleter ) );
121     lineFileEdit->setCompleter( fileCompleter );
122
123     // Hide the subtitles control by default.
124     ui.subFrame->hide();
125
126     /* Build the subs size combo box */
127     setfillVLCConfigCombo( "freetype-rel-fontsize" , p_intf,
128                             ui.sizeSubComboBox );
129
130     /* Build the subs align combo box */
131     setfillVLCConfigCombo( "subsdec-align", p_intf, ui.alignSubComboBox );
132
133     /* Connects  */
134     BUTTONACT( ui.subBrowseButton, browseFileSub() );
135     BUTTONACT( ui.subCheckBox, toggleSubtitleFrame());
136
137     CONNECT( lineFileEdit, textChanged( QString ), this, updateMRL() );
138     CONNECT( ui.subInput, textChanged( QString ), this, updateMRL() );
139     CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this, updateMRL() );
140     CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this, updateMRL() );
141 }
142
143 FileOpenPanel::~FileOpenPanel()
144 {
145 #if HAS_QT43
146     getSettings()->setValue( "file-dialog-state", dialogBox->saveState() );
147 #endif
148 }
149
150 /* Show a fileBrowser to select a subtitle */
151 void FileOpenPanel::browseFileSub()
152 {
153     // TODO Handle selection of more than one subtitles file
154     QStringList files = THEDP->showSimpleOpen( qtr("Open subtitles file"),
155                             EXT_FILTER_SUBTITLE,
156                             dialogBox->directory().absolutePath() );
157     if( files.isEmpty() ) return;
158     ui.subInput->setText( files.join(" ") );
159     updateMRL();
160 }
161
162 /* Update the current MRL */
163 void FileOpenPanel::updateMRL()
164 {
165     QString mrl = "";
166     foreach( QString file, dialogBox->selectedFiles() ) {
167          mrl += "\"" + file + "\" ";
168     }
169
170     if( ui.subCheckBox->isChecked() ) {
171         mrl.append( " :sub-file=\"" + ui.subInput->text() + "\"" );
172         int align = ui.alignSubComboBox->itemData(
173                     ui.alignSubComboBox->currentIndex() ).toInt();
174         mrl.append( " :subsdec-align=" + QString().setNum( align ) );
175         int size = ui.sizeSubComboBox->itemData(
176                    ui.sizeSubComboBox->currentIndex() ).toInt();
177         mrl.append( " :freetype-rel-fontsize=" + QString().setNum( size ) );
178     }
179
180     emit mrlUpdated( mrl );
181     emit methodChanged( "file-caching" );
182 }
183
184 /* Function called by Open Dialog when clicke on Play/Enqueue */
185 void FileOpenPanel::accept()
186 {
187     //TODO set the completer
188     p_intf->p_sys->psz_filepath = qtu( dialogBox->directory().absolutePath() );
189 }
190
191 void FileOpenBox::accept()
192 {
193     OpenDialog::getInstance( NULL, NULL, true )->selectSlots();
194 }
195
196 /* Function called by Open Dialog when clicked on cancel */
197 void FileOpenPanel::clear()
198 {
199     lineFileEdit->clear();
200     ui.subInput->clear();
201 }
202
203 void FileOpenPanel::toggleSubtitleFrame()
204 {
205     TOGGLEV( ui.subFrame );
206
207     /* Update the MRL */
208     updateMRL();
209 }
210
211 /**************************************************************************
212  * Open Discs ( DVD, CD, VCD and similar devices )                        *
213  **************************************************************************/
214 DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
215                                 OpenPanel( _parent, _p_intf )
216 {
217     ui.setupUi( this );
218
219     /* Get the default configuration path for the devices */
220     psz_dvddiscpath = config_GetPsz( p_intf, "dvd" );
221     psz_vcddiscpath = config_GetPsz( p_intf, "vcd" );
222     psz_cddadiscpath = config_GetPsz( p_intf, "cd-audio" );
223
224     /* State to avoid overwritting the users changes with the configuration */
225     b_firstdvd = true;
226     b_firstvcd = true;
227     b_firstcdda = true;
228
229     ui.browseDiscButton->setToolTip( I_DEVICE_TOOLTIP );
230     ui.deviceCombo->setToolTip( I_DEVICE_TOOLTIP );
231
232 #if WIN32 /* Disc drives probing for Windows */
233     char szDrives[512];
234     szDrives[0] = '\0';
235     if( GetLogicalDriveStringsA( sizeof( szDrives ) - 1, szDrives ) )
236     {
237         char *drive = szDrives;
238         UINT oldMode = SetErrorMode( SEM_FAILCRITICALERRORS );
239         while( *drive )
240         {
241             if( GetDriveTypeA(drive) == DRIVE_CDROM )
242                 ui.deviceCombo->addItem( drive );
243
244             /* go to next drive */
245             while( *(drive++) );
246         }
247         SetErrorMode(oldMode);
248     }
249 #else /* Use a Completer under Linux */
250     QCompleter *discCompleter = new QCompleter( this );
251     discCompleter->setModel( new QDirModel( discCompleter ) );
252     ui.deviceCombo->setCompleter( discCompleter );
253 #endif
254
255     /* CONNECTs */
256     BUTTONACT( ui.dvdRadioButton, updateButtons() );
257     BUTTONACT( ui.vcdRadioButton, updateButtons() );
258     BUTTONACT( ui.audioCDRadioButton, updateButtons() );
259     BUTTONACT( ui.dvdsimple, updateButtons() );
260     BUTTONACT( ui.browseDiscButton, browseDevice() );
261     BUTTON_SET_ACT_I( ui.ejectButton, "", eject, qtr( "Eject the disc" ),
262             eject() );
263
264     CONNECT( ui.deviceCombo, editTextChanged( QString ), this, updateMRL());
265     CONNECT( ui.titleSpin, valueChanged( int ), this, updateMRL());
266     CONNECT( ui.chapterSpin, valueChanged( int ), this, updateMRL());
267     CONNECT( ui.audioSpin, valueChanged( int ), this, updateMRL());
268     CONNECT( ui.subtitlesSpin, valueChanged( int ), this, updateMRL());
269
270     /* Run once the updateButtons function in order to fill correctly the comboBoxes */
271     updateButtons();
272 }
273
274 DiscOpenPanel::~DiscOpenPanel()
275 {
276     free( psz_dvddiscpath );
277     free( psz_vcddiscpath );
278     free( psz_cddadiscpath );
279 }
280
281 void DiscOpenPanel::clear()
282 {
283     ui.titleSpin->setValue( 0 );
284     ui.chapterSpin->setValue( 0 );
285     b_firstcdda = true;
286     b_firstdvd = true;
287     b_firstvcd = true;
288 }
289
290 #ifdef WIN32
291     #define setDrive( psz_name ) {\
292     int index = ui.deviceCombo->findText( qfu( psz_name ) ); \
293     if( index != -1 ) ui.deviceCombo->setCurrentIndex( index );}
294 #else
295     #define setDrive( psz_name ) {\
296     ui.deviceCombo->setEditText( qfu( psz_name ) ); }
297 #endif
298
299 /* update the buttons according the type of device */
300 void DiscOpenPanel::updateButtons()
301 {
302     if ( ui.dvdRadioButton->isChecked() )
303     {
304         if( b_firstdvd )
305         {
306             setDrive( psz_dvddiscpath );
307             b_firstdvd = false;
308         }
309         ui.titleLabel->setText( qtr("Title") );
310         ui.chapterLabel->show();
311         ui.chapterSpin->show();
312         ui.diskOptionBox_2->show();
313         ui.dvdsimple->setEnabled( true );
314     }
315     else if ( ui.vcdRadioButton->isChecked() )
316     {
317         if( b_firstvcd )
318         {
319             setDrive( psz_vcddiscpath );
320             b_firstvcd = false;
321         }
322         ui.titleLabel->setText( qtr("Entry") );
323         ui.chapterLabel->hide();
324         ui.chapterSpin->hide();
325         ui.diskOptionBox_2->show();
326         ui.dvdsimple->setEnabled( false );
327     }
328     else /* CDDA */
329     {
330         if( b_firstcdda )
331         {
332             setDrive( psz_cddadiscpath );
333             b_firstcdda = false;
334         }
335         ui.titleLabel->setText( qtr("Track") );
336         ui.chapterLabel->hide();
337         ui.chapterSpin->hide();
338         ui.diskOptionBox_2->hide();
339         ui.dvdsimple->setEnabled( false );
340     }
341
342     updateMRL();
343 }
344
345 /* Update the current MRL */
346 void DiscOpenPanel::updateMRL()
347 {
348     QString mrl = "";
349
350     /* CDDAX and VCDX not implemented. TODO ? */
351     /* DVD */
352     if( ui.dvdRadioButton->isChecked() ) {
353         if( !ui.dvdsimple->isChecked() )
354             mrl = "\"dvd://";
355         else
356             mrl = "\"dvdsimple://";
357         mrl += ui.deviceCombo->currentText();
358         emit methodChanged( "dvdnav-caching" );
359
360         if ( ui.titleSpin->value() > 0 ) {
361             mrl += QString("@%1").arg( ui.titleSpin->value() );
362             if ( ui.chapterSpin->value() > 0 ) {
363                 mrl+= QString(":%1").arg( ui.chapterSpin->value() );
364             }
365         }
366
367     /* VCD */
368     } else if ( ui.vcdRadioButton->isChecked() ) {
369         mrl = "\"vcd://" + ui.deviceCombo->currentText();
370         emit methodChanged( "vcd-caching" );
371
372         if( ui.titleSpin->value() > 0 ) {
373             mrl += QString("@E%1").arg( ui.titleSpin->value() );
374         }
375
376     /* CDDA */
377     } else {
378         mrl = "\"cdda://" + ui.deviceCombo->currentText();
379         if( ui.titleSpin->value() > 0 ) {
380             QString("@%1").arg( ui.titleSpin->value() );
381         }
382     }
383
384     mrl += "\"";
385
386     if ( ui.dvdRadioButton->isChecked() || ui.vcdRadioButton->isChecked() )
387     {
388         if ( ui.audioSpin->value() >= 0 ) {
389             mrl += " :audio-track=" +
390                 QString("%1").arg( ui.audioSpin->value() );
391         }
392         if ( ui.subtitlesSpin->value() >= 0 ) {
393             mrl += " :sub-track=" +
394                 QString("%1").arg( ui.subtitlesSpin->value() );
395         }
396     }
397     emit mrlUpdated( mrl );
398 }
399
400 void DiscOpenPanel::browseDevice()
401 {
402     QString dir = QFileDialog::getExistingDirectory( 0,
403             qtr( I_DEVICE_TOOLTIP ) );
404     if (!dir.isEmpty()) {
405         ui.deviceCombo->setEditText( dir );
406     }
407     updateMRL();
408 }
409
410 void DiscOpenPanel::eject()
411 {
412     intf_Eject( p_intf, qtu( ui.deviceCombo->currentText() ) );
413 }
414
415 void DiscOpenPanel::accept()
416 {}
417
418 /**************************************************************************
419  * Open Network streams and URL pages                                     *
420  **************************************************************************/
421 NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
422                                 OpenPanel( _parent, _p_intf )
423 {
424     ui.setupUi( this );
425
426     /* CONNECTs */
427     CONNECT( ui.protocolCombo, activated( int ),
428              this, updateProtocol( int ) );
429     CONNECT( ui.portSpin, valueChanged( int ), this, updateMRL() );
430     CONNECT( ui.addressText, textChanged( QString ), this, updateMRL());
431     CONNECT( ui.timeShift, clicked(), this, updateMRL());
432
433     ui.protocolCombo->addItem( "" );
434     ui.protocolCombo->addItem("HTTP", QVariant("http"));
435     ui.protocolCombo->addItem("HTTPS", QVariant("https"));
436     ui.protocolCombo->addItem("MMS", QVariant("mms"));
437     ui.protocolCombo->addItem("FTP", QVariant("ftp"));
438     ui.protocolCombo->addItem("RTSP", QVariant("rtsp"));
439     ui.protocolCombo->addItem("RTP", QVariant("rtp"));
440     ui.protocolCombo->addItem("UDP", QVariant("udp"));
441     ui.protocolCombo->addItem("RTMP", QVariant("rtmp"));
442
443     updateProtocol( ui.protocolCombo->currentIndex() );
444 }
445
446 NetOpenPanel::~NetOpenPanel()
447 {}
448
449 void NetOpenPanel::clear()
450 {}
451
452 /* update the widgets according the type of protocol */
453 void NetOpenPanel::updateProtocol( int idx_proto ) {
454     QString addr = ui.addressText->text();
455     QString proto = ui.protocolCombo->itemData( idx_proto ).toString();
456
457     ui.timeShift->setEnabled( idx_proto == UDP_PROTO );
458     ui.portSpin->setEnabled( idx_proto == UDP_PROTO ||
459                              idx_proto == RTP_PROTO );
460
461     if( idx_proto == NO_PROTO ) return;
462
463     /* If we already have a protocol in the address, replace it */
464     if( addr.contains( "://"))
465     {
466         if( idx_proto != UDP_PROTO && idx_proto != RTP_PROTO )
467             addr.replace( QRegExp("^.*://@*"), proto + "://");
468         else
469              addr.replace( QRegExp("^.*://"), proto + "://@");
470         ui.addressText->setText( addr );
471     }
472     updateMRL();
473 }
474
475 void NetOpenPanel::updateMRL() {
476     QString mrl = "";
477     QString addr = ui.addressText->text();
478     addr = QUrl::toPercentEncoding( addr, ":/?#@!$&'()*+,;=" );
479     int idx_proto = ui.protocolCombo->currentIndex();
480
481     if( addr.contains( "://"))
482     {
483         /* Match the correct item in the comboBox */
484         ui.protocolCombo->setCurrentIndex(
485                 ui.protocolCombo->findData( addr.section( ':', 0, 0 ) ) );
486
487         if( idx_proto != UDP_PROTO || idx_proto != RTP_PROTO )
488             mrl = addr;
489     }
490     else
491     {
492         switch( idx_proto ) {
493         case HTTP_PROTO:
494             mrl = "http://" + addr;
495             emit methodChanged("http-caching");
496             break;
497         case HTTPS_PROTO:
498             mrl = "https://" + addr;
499             emit methodChanged("http-caching");
500             break;
501         case MMS_PROTO:
502             mrl = "mms://" + addr;
503             emit methodChanged("mms-caching");
504             break;
505         case FTP_PROTO:
506             mrl = "ftp://" + addr;
507             emit methodChanged("ftp-caching");
508             break;
509         case RTSP_PROTO:
510             mrl = "rtsp://" + addr;
511             emit methodChanged("rtsp-caching");
512             break;
513         case UDP_PROTO:
514             mrl = "udp://@";
515             /* Add [] to IPv6 */
516             if ( addr.contains(':') && !addr.contains('[') )
517             {
518                 mrl += "[" + addr + "]";
519             }
520             else mrl += addr;
521             mrl += QString(":%1").arg( ui.portSpin->value() );
522             emit methodChanged("udp-caching");
523             break;
524         case RTP_PROTO:
525             mrl = "rtp://@";
526             if ( addr.contains(':') && !addr.contains('[') )
527                 mrl += "[" + addr + "]"; /* Add [] to IPv6 */
528             else
529                 mrl += addr;
530             mrl += QString(":%1").arg( ui.portSpin->value() );
531             emit methodChanged("rtp-caching");
532             break;
533         case RTMP_PROTO:
534             mrl = "rtmp://" + addr;
535             emit methodChanged("rtmp-caching");
536             break;
537         }
538     }
539
540     // Encode the boring stuffs
541
542     if( ui.timeShift->isEnabled() && ui.timeShift->isChecked() ) {
543         mrl += " :access-filter=timeshift";
544     }
545     emit mrlUpdated( mrl );
546 }
547
548 /**************************************************************************
549  * Open Capture device ( DVB, PVR, V4L, and similar )                     *
550  **************************************************************************/
551 CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
552                                 OpenPanel( _parent, _p_intf )
553 {
554     ui.setupUi( this );
555
556     BUTTONACT( ui.advancedButton, advancedDialog() );
557
558     /* Create two stacked layouts in the main comboBoxes */
559     QStackedLayout *stackedDevLayout = new QStackedLayout;
560     ui.cardBox->setLayout( stackedDevLayout );
561
562     QStackedLayout *stackedPropLayout = new QStackedLayout;
563     ui.optionsBox->setLayout( stackedPropLayout );
564
565     /* Creation and connections of the WIdgets in the stacked layout */
566 #define addModuleAndLayouts( number, name, label )                    \
567     QWidget * name ## DevPage = new QWidget( this );                  \
568     QWidget * name ## PropPage = new QWidget( this );                 \
569     stackedDevLayout->addWidget( name ## DevPage );        \
570     stackedPropLayout->addWidget( name ## PropPage );      \
571     QGridLayout * name ## DevLayout = new QGridLayout;                \
572     QGridLayout * name ## PropLayout = new QGridLayout;               \
573     name ## DevPage->setLayout( name ## DevLayout );                  \
574     name ## PropPage->setLayout( name ## PropLayout );                \
575     ui.deviceCombo->addItem( qtr( label ), QVariant( number ) );
576
577 #define CuMRL( widget, slot ) CONNECT( widget , slot , this, updateMRL() );
578
579 #ifdef WIN32
580     /*********************
581      * DirectShow Stuffs *
582      *********************/
583     if( module_Exists( p_intf, "dshow" ) ){
584     addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow" );
585
586     /* dshow Main */
587     int line = 0;
588     module_config_t *p_config =
589         config_FindConfig( VLC_OBJECT(p_intf), "dshow-vdev" );
590     vdevDshowW = new StringListConfigControl(
591         VLC_OBJECT(p_intf), p_config, this, false, dshowDevLayout, line );
592     line++;
593
594     p_config = config_FindConfig( VLC_OBJECT(p_intf), "dshow-adev" );
595     adevDshowW = new StringListConfigControl(
596         VLC_OBJECT(p_intf), p_config, this, false, dshowDevLayout, line );
597     line++;
598
599     /* dshow Properties */
600     QLabel *dshowVSizeLabel = new QLabel( qtr( "Video size" ) );
601     dshowPropLayout->addWidget( dshowVSizeLabel, 0, 0 );
602
603     dshowVSizeLine = new QLineEdit;
604     dshowPropLayout->addWidget( dshowVSizeLine, 0, 1);
605     dshowPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
606             1, 0, 3, 1 );
607
608     /* dshow CONNECTs */
609     CuMRL( vdevDshowW->combo, currentIndexChanged ( int ) );
610     CuMRL( adevDshowW->combo, currentIndexChanged ( int ) );
611     CuMRL( dshowVSizeLine, textChanged( QString ) );
612     }
613
614     /**************
615      * BDA Stuffs *
616      **************/
617     if( module_Exists( p_intf, "bda" ) ){
618     addModuleAndLayouts( BDA_DEVICE, bda, "DVB DirectShow" );
619
620     /* bda Main */
621     QLabel *bdaTypeLabel = new QLabel( qtr( "DVB Type:" ) );
622
623     bdas = new QRadioButton( "DVB-S" );
624     bdas->setChecked( true );
625     bdac = new QRadioButton( "DVB-C" );
626     bdat = new QRadioButton( "DVB-T" );
627
628     bdaDevLayout->addWidget( bdaTypeLabel, 0, 0 );
629     bdaDevLayout->addWidget( bdas, 0, 1 );
630     bdaDevLayout->addWidget( bdac, 0, 2 );
631     bdaDevLayout->addWidget( bdat, 0, 3 );
632
633     /* bda Props */
634     QLabel *bdaFreqLabel =
635                     new QLabel( qtr( "Transponder/multiplex frequency" ) );
636     bdaPropLayout->addWidget( bdaFreqLabel, 0, 0 );
637
638     bdaFreq = new QSpinBox;
639     bdaFreq->setAlignment( Qt::AlignRight );
640     bdaFreq->setSuffix(" kHz");
641     bdaFreq->setSingleStep( 1000 );
642     setSpinBoxFreq( bdaFreq )
643     bdaPropLayout->addWidget( bdaFreq, 0, 1 );
644
645     bdaSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
646     bdaPropLayout->addWidget( bdaSrateLabel, 1, 0 );
647
648     bdaSrate = new QSpinBox;
649     bdaSrate->setAlignment( Qt::AlignRight );
650     bdaSrate->setSuffix(" kHz");
651     setSpinBoxFreq( bdaSrate );
652     bdaPropLayout->addWidget( bdaSrate, 1, 1 );
653
654     bdaBandLabel = new QLabel( qtr( "Bandwidth" ) );
655     bdaPropLayout->addWidget( bdaBandLabel, 2, 0 );
656
657     bdaBandBox = new QComboBox;
658     setfillVLCConfigCombo( "dvb-bandwidth", p_intf, bdaBandBox );
659     bdaPropLayout->addWidget( bdaBandBox, 2, 1 );
660
661     bdaBandLabel->hide();
662     bdaBandBox->hide();
663     bdaPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
664             2, 0, 2, 1 );
665
666     /* bda CONNECTs */
667     CuMRL( bdaFreq, valueChanged ( int ) );
668     CuMRL( bdaSrate, valueChanged ( int ) );
669     CuMRL( bdaBandBox,  currentIndexChanged ( int ) );
670     BUTTONACT( bdas, updateButtons() );
671     BUTTONACT( bdat, updateButtons() );
672     BUTTONACT( bdac, updateButtons() );
673     BUTTONACT( bdas, updateMRL() );
674     BUTTONACT( bdat, updateMRL() );
675     BUTTONACT( bdac, updateMRL() );
676     }
677
678 #else /* WIN32 */
679     /*******
680      * V4L2*
681      *******/
682     if( module_Exists( p_intf, "v4l2" ) ){
683     addModuleAndLayouts( V4L2_DEVICE, v4l2, "Video for Linux 2" );
684
685     /* V4l Main panel */
686     QLabel *v4l2VideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
687     v4l2DevLayout->addWidget( v4l2VideoDeviceLabel, 0, 0 );
688
689     v4l2VideoDevice = new QLineEdit;
690     v4l2DevLayout->addWidget( v4l2VideoDevice, 0, 1 );
691
692     QLabel *v4l2AudioDeviceLabel = new QLabel( qtr( "Audio device name" ) );
693     v4l2DevLayout->addWidget( v4l2AudioDeviceLabel, 1, 0 );
694
695     v4l2AudioDevice = new QLineEdit;
696     v4l2DevLayout->addWidget( v4l2AudioDevice, 1, 1 );
697
698     /* v4l2 Props panel */
699     QLabel *v4l2StdLabel = new QLabel( qtr( "Standard" ) );
700     v4l2PropLayout->addWidget( v4l2StdLabel, 0 , 0 );
701
702     v4l2StdBox = new QComboBox;
703     setfillVLCConfigCombo( "v4l2-standard", p_intf, v4l2StdBox );
704     v4l2PropLayout->addWidget( v4l2StdBox, 0 , 1 );
705     v4l2PropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
706             1, 0, 3, 1 );
707
708     /* v4l2 CONNECTs */
709     CuMRL( v4l2VideoDevice, textChanged( QString ) );
710     CuMRL( v4l2AudioDevice, textChanged( QString ) );
711     CuMRL( v4l2StdBox,  currentIndexChanged ( int ) );
712     }
713
714     /*******
715      * V4L *
716      *******/
717     if( module_Exists( p_intf, "v4l" ) ){
718     addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux" );
719
720     /* V4l Main panel */
721     QLabel *v4lVideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
722     v4lDevLayout->addWidget( v4lVideoDeviceLabel, 0, 0 );
723
724     v4lVideoDevice = new QLineEdit;
725     v4lDevLayout->addWidget( v4lVideoDevice, 0, 1 );
726
727     QLabel *v4lAudioDeviceLabel = new QLabel( qtr( "Audio device name" ) );
728     v4lDevLayout->addWidget( v4lAudioDeviceLabel, 1, 0 );
729
730     v4lAudioDevice = new QLineEdit;
731     v4lDevLayout->addWidget( v4lAudioDevice, 1, 1 );
732
733     /* V4l Props panel */
734     QLabel *v4lNormLabel = new QLabel( qtr( "Norm" ) );
735     v4lPropLayout->addWidget( v4lNormLabel, 0 , 0 );
736
737     v4lNormBox = new QComboBox;
738     setfillVLCConfigCombo( "v4l-norm", p_intf, v4lNormBox );
739     v4lPropLayout->addWidget( v4lNormBox, 0 , 1 );
740
741     QLabel *v4lFreqLabel = new QLabel( qtr( "Frequency" ) );
742     v4lPropLayout->addWidget( v4lFreqLabel, 1 , 0 );
743
744     v4lFreq = new QSpinBox;
745     v4lFreq->setAlignment( Qt::AlignRight );
746     v4lFreq->setSuffix(" kHz");
747     setSpinBoxFreq( v4lFreq );
748     v4lPropLayout->addWidget( v4lFreq, 1 , 1 );
749     v4lPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
750             2, 0, 2, 1 );
751
752     /* v4l CONNECTs */
753     CuMRL( v4lVideoDevice, textChanged( QString ) );
754     CuMRL( v4lAudioDevice, textChanged( QString ) );
755     CuMRL( v4lFreq, valueChanged ( int ) );
756     CuMRL( v4lNormBox,  currentIndexChanged ( int ) );
757     }
758
759     /*******
760      * JACK *
761      *******/
762     if( module_Exists( p_intf, "jack" ) ){
763     addModuleAndLayouts( JACK_DEVICE, jack, "JACK Audio Connection Kit" );
764
765     /* Jack Main panel */
766     /* Channels */
767     QLabel *jackChannelsLabel = new QLabel( qtr( "Channels:" ) );
768     jackDevLayout->addWidget( jackChannelsLabel, 1, 0 );
769
770     jackChannels = new QSpinBox;
771     setSpinBoxFreq( jackChannels );
772     jackChannels->setMaximum(255);
773     jackChannels->setValue(2);
774     jackChannels->setAlignment( Qt::AlignRight );
775     jackDevLayout->addWidget( jackChannels, 1, 1 );
776
777     /* Jack Props panel */
778
779     /* Selected ports */
780     QLabel *jackPortsLabel = new QLabel( qtr( "Selected ports:" ) );
781     jackPropLayout->addWidget( jackPortsLabel, 0 , 0 );
782
783     jackPortsSelected = new QLineEdit( qtr( ".*") );
784     jackPortsSelected->setAlignment( Qt::AlignRight );
785     jackPropLayout->addWidget( jackPortsSelected, 0, 1 );
786
787     /* Caching */
788     QLabel *jackCachingLabel = new QLabel( qtr( "Input caching:" ) );
789     jackPropLayout->addWidget( jackCachingLabel, 1 , 0 );
790     jackCaching = new QSpinBox;
791     setSpinBoxFreq( jackCaching );
792     jackCaching->setSuffix( " ms" );
793     jackCaching->setValue(1000);
794     jackCaching->setAlignment( Qt::AlignRight );
795     jackPropLayout->addWidget( jackCaching, 1 , 1 );
796
797     /* Pace */
798     jackPace = new QCheckBox(qtr( "Use VLC pace" ));
799     jackPropLayout->addWidget( jackPace, 2, 1 );
800
801     /* Auto Connect */
802     jackConnect = new QCheckBox( qtr( "Auto connnection" ));
803     jackPropLayout->addWidget( jackConnect, 3, 1 );
804
805     /* Jack CONNECTs */
806     CuMRL( jackChannels, valueChanged( int ) );
807     CuMRL( jackCaching, valueChanged( int ) );
808     CuMRL( jackPace, stateChanged( int ) );
809     CuMRL( jackConnect, stateChanged( int ) );
810     CuMRL( jackPortsSelected, textChanged( QString ) );
811     }
812
813     /************
814      * PVR      *
815      ************/
816     if( module_Exists( p_intf, "pvr" ) ){
817     addModuleAndLayouts( PVR_DEVICE, pvr, "PVR" );
818
819     /* PVR Main panel */
820     QLabel *pvrDeviceLabel = new QLabel( qtr( "Device name" ) );
821     pvrDevLayout->addWidget( pvrDeviceLabel, 0, 0 );
822
823     pvrDevice = new QLineEdit;
824     pvrDevLayout->addWidget( pvrDevice, 0, 1 );
825
826     QLabel *pvrRadioDeviceLabel = new QLabel( qtr( "Radio device name" ) );
827     pvrDevLayout->addWidget( pvrRadioDeviceLabel, 1, 0 );
828
829     pvrRadioDevice = new QLineEdit;
830     pvrDevLayout->addWidget( pvrRadioDevice, 1, 1 );
831
832     /* PVR props panel */
833     QLabel *pvrNormLabel = new QLabel( qtr( "Norm" ) );
834     pvrPropLayout->addWidget( pvrNormLabel, 0, 0 );
835
836     pvrNormBox = new QComboBox;
837     setfillVLCConfigCombo( "pvr-norm", p_intf, pvrNormBox );
838     pvrPropLayout->addWidget( pvrNormBox, 0, 1 );
839
840     QLabel *pvrFreqLabel = new QLabel( qtr( "Frequency" ) );
841     pvrPropLayout->addWidget( pvrFreqLabel, 1, 0 );
842
843     pvrFreq = new QSpinBox;
844     pvrFreq->setAlignment( Qt::AlignRight );
845     pvrFreq->setSuffix(" kHz");
846     setSpinBoxFreq( pvrFreq );
847     pvrPropLayout->addWidget( pvrFreq, 1, 1 );
848
849     QLabel *pvrBitrLabel = new QLabel( qtr( "Bitrate" ) );
850     pvrPropLayout->addWidget( pvrBitrLabel, 2, 0 );
851
852     pvrBitr = new QSpinBox;
853     pvrBitr->setAlignment( Qt::AlignRight );
854     pvrBitr->setSuffix(" kHz");
855     setSpinBoxFreq( pvrBitr );
856     pvrPropLayout->addWidget( pvrBitr, 2, 1 );
857     pvrPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
858             3, 0, 1, 1 );
859
860     /* PVR CONNECTs */
861     CuMRL( pvrDevice, textChanged( QString ) );
862     CuMRL( pvrRadioDevice, textChanged( QString ) );
863
864     CuMRL( pvrFreq, valueChanged ( int ) );
865     CuMRL( pvrBitr, valueChanged ( int ) );
866     CuMRL( pvrNormBox, currentIndexChanged ( int ) );
867     }
868
869     /**************
870      * DVB Stuffs *
871      **************/
872     if( module_Exists( p_intf, "dvb" ) ){
873     addModuleAndLayouts( DVB_DEVICE, dvb, "DVB" );
874
875     /* DVB Main */
876     QLabel *dvbDeviceLabel = new QLabel( qtr( "Adapter card to tune" ) );
877     QLabel *dvbTypeLabel = new QLabel( qtr( "DVB Type:" ) );
878
879     dvbCard = new QSpinBox;
880     dvbCard->setAlignment( Qt::AlignRight );
881     dvbCard->setPrefix( "/dev/dvb/adapter" );
882
883     dvbDevLayout->addWidget( dvbDeviceLabel, 0, 0 );
884     dvbDevLayout->addWidget( dvbCard, 0, 2, 1, 2 );
885
886     dvbs = new QRadioButton( "DVB-S" );
887     dvbs->setChecked( true );
888     dvbc = new QRadioButton( "DVB-C" );
889     dvbt = new QRadioButton( "DVB-T" );
890
891     dvbDevLayout->addWidget( dvbTypeLabel, 1, 0 );
892     dvbDevLayout->addWidget( dvbs, 1, 1 );
893     dvbDevLayout->addWidget( dvbc, 1, 2 );
894     dvbDevLayout->addWidget( dvbt, 1, 3 );
895
896     /* DVB Props panel */
897     QLabel *dvbFreqLabel =
898                     new QLabel( qtr( "Transponder/multiplex frequency" ) );
899     dvbPropLayout->addWidget( dvbFreqLabel, 0, 0 );
900
901     dvbFreq = new QSpinBox;
902     dvbFreq->setAlignment( Qt::AlignRight );
903     dvbFreq->setSuffix(" kHz");
904     setSpinBoxFreq( dvbFreq  );
905     dvbPropLayout->addWidget( dvbFreq, 0, 1 );
906
907     QLabel *dvbSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
908     dvbPropLayout->addWidget( dvbSrateLabel, 1, 0 );
909
910     dvbSrate = new QSpinBox;
911     dvbSrate->setAlignment( Qt::AlignRight );
912     dvbSrate->setSuffix(" kHz");
913     setSpinBoxFreq( dvbSrate );
914     dvbPropLayout->addWidget( dvbSrate, 1, 1 );
915     dvbPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
916             2, 0, 2, 1 );
917
918     /* DVB CONNECTs */
919     CuMRL( dvbCard, valueChanged ( int ) );
920     CuMRL( dvbFreq, valueChanged ( int ) );
921     CuMRL( dvbSrate, valueChanged ( int ) );
922
923     BUTTONACT( dvbs, updateButtons() );
924     BUTTONACT( dvbt, updateButtons() );
925     BUTTONACT( dvbc, updateButtons() );
926     }
927
928 #endif
929
930
931     /**********
932      * Screen *
933      **********/
934     addModuleAndLayouts( SCREEN_DEVICE, screen, "Desktop" );
935     QLabel *screenLabel = new QLabel( "This option will open your own "
936             "desktop in order to save or stream it.");
937     screenLabel->setWordWrap( true );
938     screenDevLayout->addWidget( screenLabel, 0, 0 );
939
940     /* General connects */
941     CONNECT( ui.deviceCombo, activated( int ) ,
942              stackedDevLayout, setCurrentIndex( int ) );
943     CONNECT( ui.deviceCombo, activated( int ),
944              stackedPropLayout, setCurrentIndex( int ) );
945     CONNECT( ui.deviceCombo, activated( int ), this, updateMRL() );
946     CONNECT( ui.deviceCombo, activated( int ), this, updateButtons() );
947
948 #undef addModule
949 }
950
951 CaptureOpenPanel::~CaptureOpenPanel()
952 {
953 }
954
955 void CaptureOpenPanel::clear()
956 {
957     advMRL.clear();
958 }
959
960 void CaptureOpenPanel::updateMRL()
961 {
962     QString mrl = "";
963     int i_devicetype = ui.deviceCombo->itemData(
964             ui.deviceCombo->currentIndex() ).toInt();
965     switch( i_devicetype )
966     {
967 #ifdef WIN32
968     case BDA_DEVICE:
969         if( bdas->isChecked() ) mrl = "dvb-s://";
970         else if(  bdat->isChecked() ) mrl = "dvb-t://";
971         else if(  bdac->isChecked() ) mrl = "dvb-c://";
972         else return;
973         mrl += " :dvb-frequency=" + QString("%1").arg( bdaFreq->value() );
974         if( bdas->isChecked() || bdac->isChecked() )
975             mrl += " :dvb-srate=" + QString("%1").arg( bdaSrate->value() );
976         else
977             mrl += " :dvb-bandwidth=" +
978                 QString("%1").arg( bdaBandBox->itemData(
979                     bdaBandBox->currentIndex() ).toInt() );
980         break;
981     case DSHOW_DEVICE:
982         mrl = "dshow://";
983         mrl+= " :dshow-vdev=" + QString("\"%1\"").arg( vdevDshowW->getValue() );
984         mrl+= " :dshow-adev=" + QString("\"%1\"").arg( adevDshowW->getValue() );
985         if( dshowVSizeLine->isModified() )
986             mrl += " :dshow-size=" + dshowVSizeLine->text();
987         break;
988 #else
989     case V4L_DEVICE:
990         mrl = "v4l://";
991         mrl += " :v4l-vdev=" + v4lVideoDevice->text();
992         mrl += " :v4l-adev=" + v4lAudioDevice->text();
993         mrl += " :v4l-norm=" + QString("%1").arg( v4lNormBox->currentIndex() );
994         mrl += " :v4l-frequency=" + QString("%1").arg( v4lFreq->value() );
995         break;
996     case V4L2_DEVICE:
997         mrl = "v4l2://";
998         mrl += " :v4l2-dev=" + v4l2VideoDevice->text();
999         mrl += " :v4l2-adev=" + v4l2AudioDevice->text();
1000         mrl += " :v4l2-standard=" + QString("%1").arg( v4l2StdBox->currentIndex() );
1001         break;
1002     case JACK_DEVICE:
1003         mrl = "jack://";
1004         mrl += "channels=" + QString("%1").arg( jackChannels->value() );
1005         mrl += ":ports=" + jackPortsSelected->text();
1006         mrl += " --jack-input-caching=" + QString("%1").arg( jackCaching->value() );
1007         if ( jackPace->isChecked() )
1008         {
1009                 mrl += " --jack-input-use-vlc-pace";
1010         }
1011         if ( jackConnect->isChecked() )
1012         {
1013                 mrl += " --jack-input-auto-connect";
1014         }
1015         break;
1016     case PVR_DEVICE:
1017         mrl = "pvr://";
1018         mrl += " :pvr-device=" + pvrDevice->text();
1019         mrl += " :pvr-radio-device=" + pvrRadioDevice->text();
1020         mrl += " :pvr-norm=" + QString("%1").arg( pvrNormBox->currentIndex() );
1021         if( pvrFreq->value() )
1022             mrl += " :pvr-frequency=" + QString("%1").arg( pvrFreq->value() );
1023         if( pvrBitr->value() )
1024             mrl += " :pvr-bitrate=" + QString("%1").arg( pvrBitr->value() );
1025         break;
1026     case DVB_DEVICE:
1027         mrl = "dvb://";
1028         mrl += " :dvb-adapter=" + QString("%1").arg( dvbCard->value() );
1029         mrl += " :dvb-frequency=" + QString("%1").arg( dvbFreq->value() );
1030         mrl += " :dvb-srate=" + QString("%1").arg( dvbSrate->value() );
1031         break;
1032 #endif
1033     case SCREEN_DEVICE:
1034         mrl = "screen://";
1035         updateButtons();
1036         break;
1037     }
1038
1039     if( !advMRL.isEmpty() ) mrl += advMRL;
1040
1041     emit mrlUpdated( mrl );
1042 }
1043
1044 /**
1045  * Update the Buttons (show/hide) for the GUI as all device type don't
1046  * use the same ui. elements.
1047  **/
1048 void CaptureOpenPanel::updateButtons()
1049 {
1050     /*  Be sure to display the ui Elements in case they were hidden by
1051      *  some Device Type (like Screen://) */
1052     ui.optionsBox->show();
1053     ui.advancedButton->show();
1054     /* Get the current Device Number */
1055     int i_devicetype = ui.deviceCombo->itemData(
1056                                 ui.deviceCombo->currentIndex() ).toInt();
1057     switch( i_devicetype )
1058     {
1059 #ifdef WIN32
1060     case BDA_DEVICE:
1061         if( bdas->isChecked() || bdac->isChecked() )
1062         {
1063             bdaSrate->show();
1064             bdaSrateLabel->show();
1065             bdaBandBox->hide();
1066             bdaBandLabel->hide();
1067         }
1068         else
1069         {
1070             bdaSrate->hide();
1071             bdaSrateLabel->hide();
1072             bdaBandBox->show();
1073             bdaBandLabel->show();
1074         }
1075         break;
1076 #else
1077     case DVB_DEVICE:
1078         if( dvbs->isChecked() ) dvbFreq->setSuffix(" kHz");
1079         if( dvbc->isChecked() || dvbt->isChecked() ) dvbFreq->setSuffix(" Hz");
1080         break;
1081 #endif
1082     case SCREEN_DEVICE:
1083         ui.optionsBox->hide();
1084         ui.advancedButton->hide();
1085         break;
1086     }
1087
1088     advMRL.clear();
1089 }
1090
1091 void CaptureOpenPanel::advancedDialog()
1092 {
1093     /* Get selected device type */
1094     int i_devicetype = ui.deviceCombo->itemData(
1095                                 ui.deviceCombo->currentIndex() ).toInt();
1096
1097     /* Get the corresponding module */
1098     module_t *p_module =
1099         module_Find( VLC_OBJECT(p_intf), psz_devModule[i_devicetype] );
1100     if( NULL == p_module ) return;
1101
1102     /* Init */
1103     QList<ConfigControl *> controls;
1104
1105     /* Get the confsize  */
1106     unsigned int i_confsize;
1107     module_config_t *p_config;
1108     p_config = module_GetConfig( p_module, &i_confsize );
1109
1110     /* New Adv Prop dialog */
1111     adv = new QDialog( this );
1112     adv->setWindowTitle( qtr( "Advanced Options" ) );
1113
1114     /* A main Layout with a Frame */
1115     QVBoxLayout *mainLayout = new QVBoxLayout( adv );
1116     QFrame *advFrame = new QFrame;
1117     QScrollArea *scroll = new QScrollArea;
1118     mainLayout->addWidget( scroll );
1119
1120     /* GridLayout inside the Frame */
1121     QGridLayout *gLayout = new QGridLayout( advFrame );
1122     gLayout->setSizeConstraint( QLayout::SetFixedSize );
1123
1124     scroll->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
1125     scroll->setWidgetResizable( true );
1126     scroll->setWidget( advFrame );
1127
1128     /* Create the options inside the FrameLayout */
1129     for( int n = 0; n < i_confsize; n++ )
1130     {
1131         module_config_t *p_item = p_config + n;
1132         ConfigControl *config = ConfigControl::createControl(
1133                         VLC_OBJECT( p_intf ), p_item, advFrame, gLayout, n );
1134         controls.append( config );
1135     }
1136
1137     /* Button stuffs */
1138     QDialogButtonBox *advButtonBox = new QDialogButtonBox( adv );
1139     QPushButton *closeButton = new QPushButton( qtr( "OK" ) );
1140     QPushButton *cancelButton = new QPushButton( qtr( "Cancel" ) );
1141
1142     CONNECT( closeButton, clicked(), adv, accept() );
1143     CONNECT( cancelButton, clicked(), adv, reject() );
1144
1145     advButtonBox->addButton( closeButton, QDialogButtonBox::AcceptRole );
1146     advButtonBox->addButton( cancelButton, QDialogButtonBox::RejectRole );
1147
1148     mainLayout->addWidget( advButtonBox );
1149
1150     /* Creation of the MRL */
1151     if( adv->exec() )
1152     {
1153         QString tempMRL = "";
1154         for( int i = 0; i < controls.size(); i++ )
1155         {
1156             ConfigControl *control = controls[i];
1157             if( !control )
1158             {
1159                 msg_Dbg( p_intf, "This shouldn't happen, please report" );
1160                 continue;
1161             }
1162
1163             tempMRL += (i ? " :" : ":");
1164
1165             if( control->getType() == CONFIG_ITEM_BOOL )
1166                 if( !(qobject_cast<VIntConfigControl *>(control)->getValue() ) )
1167                     tempMRL += "no-";
1168
1169             tempMRL += control->getName();
1170
1171             switch( control->getType() )
1172             {
1173                 case CONFIG_ITEM_STRING:
1174                 case CONFIG_ITEM_FILE:
1175                 case CONFIG_ITEM_DIRECTORY:
1176                 case CONFIG_ITEM_MODULE:
1177                     tempMRL += QString("=\"%1\"").arg( qobject_cast<VStringConfigControl *>(control)->getValue() );
1178                     break;
1179                 case CONFIG_ITEM_INTEGER:
1180                     tempMRL += QString("=%1").arg( qobject_cast<VIntConfigControl *>(control)->getValue() );
1181                     break;
1182                 case CONFIG_ITEM_FLOAT:
1183                     tempMRL += QString("=%1").arg( qobject_cast<VFloatConfigControl *>(control)->getValue() );
1184                     break;
1185             }
1186         }
1187         advMRL = tempMRL;
1188         updateMRL();
1189         msg_Dbg( p_intf, "%s", qtu( advMRL ) );
1190     }
1191     delete adv;
1192 }
1193