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