]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/open_panels.cpp
ae087c1336af1da972160fdb2f072974cff44e79
[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 )->play();
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     }
303     else if ( ui.vcdRadioButton->isChecked() )
304     {
305         if( b_firstvcd )
306         {
307             setDrive( psz_vcddiscpath );
308             b_firstvcd = false;
309         }
310         ui.titleLabel->setText( qtr("Entry") );
311         ui.chapterLabel->hide();
312         ui.chapterSpin->hide();
313         ui.diskOptionBox_2->show();
314     }
315     else /* CDDA */
316     {
317         if( b_firstcdda )
318         {
319             setDrive( psz_cddadiscpath );
320             b_firstcdda = false;
321         }
322         ui.titleLabel->setText( qtr("Track") );
323         ui.chapterLabel->hide();
324         ui.chapterSpin->hide();
325         ui.diskOptionBox_2->hide();
326     }
327
328     updateMRL();
329 }
330
331 /* Update the current MRL */
332 void DiscOpenPanel::updateMRL()
333 {
334     QString mrl = "";
335
336     /* CDDAX and VCDX not implemented. TODO ? */
337     /* DVD */
338     if( ui.dvdRadioButton->isChecked() ) {
339         if( !ui.dvdsimple->isChecked() )
340             mrl = "\"dvd://";
341         else
342             mrl = "\"dvdsimple://";
343         mrl += ui.deviceCombo->currentText();
344         emit methodChanged( "dvdnav-caching" );
345
346         if ( ui.titleSpin->value() > 0 ) {
347             mrl += QString("@%1").arg( ui.titleSpin->value() );
348             if ( ui.chapterSpin->value() > 0 ) {
349                 mrl+= QString(":%1").arg( ui.chapterSpin->value() );
350             }
351         }
352
353     /* VCD */
354     } else if ( ui.vcdRadioButton->isChecked() ) {
355         mrl = "\"vcd://" + ui.deviceCombo->currentText();
356         emit methodChanged( "vcd-caching" );
357
358         if( ui.titleSpin->value() > 0 ) {
359             mrl += QString("@E%1").arg( ui.titleSpin->value() );
360         }
361
362     /* CDDA */
363     } else {
364         mrl = "\"cdda://" + ui.deviceCombo->currentText();
365         if( ui.titleSpin->value() > 0 ) {
366             QString("@%1").arg( ui.titleSpin->value() );
367         }
368     }
369
370     mrl += "\"";
371
372     if ( ui.dvdRadioButton->isChecked() || ui.vcdRadioButton->isChecked() )
373     {
374         if ( ui.audioSpin->value() >= 0 ) {
375             mrl += " :audio-track=" +
376                 QString("%1").arg( ui.audioSpin->value() );
377         }
378         if ( ui.subtitlesSpin->value() >= 0 ) {
379             mrl += " :sub-track=" +
380                 QString("%1").arg( ui.subtitlesSpin->value() );
381         }
382     }
383     emit mrlUpdated( mrl );
384 }
385
386 void DiscOpenPanel::browseDevice()
387 {
388     QString dir = QFileDialog::getExistingDirectory( 0,
389             qtr("Open a device or a VIDEO_TS directory") );
390     if (!dir.isEmpty()) {
391         ui.deviceCombo->setEditText( dir );
392     }
393     updateMRL();
394 }
395
396 void DiscOpenPanel::eject()
397 {
398     intf_Eject( p_intf, qtu( ui.deviceCombo->currentText() ) );
399 }
400
401 void DiscOpenPanel::accept()
402 {}
403
404 /**************************************************************************
405  * Open Network streams and URL pages                                     *
406  **************************************************************************/
407 NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
408                                 OpenPanel( _parent, _p_intf )
409 {
410     ui.setupUi( this );
411
412     /* CONNECTs */
413     CONNECT( ui.protocolCombo, activated( int ),
414              this, updateProtocol( int ) );
415     CONNECT( ui.portSpin, valueChanged( int ), this, updateMRL() );
416     CONNECT( ui.addressText, textChanged( QString ), this, updateMRL());
417     CONNECT( ui.timeShift, clicked(), this, updateMRL());
418     CONNECT( ui.ipv6, clicked(), this, updateMRL());
419
420     typedef QPair<QString,QString> QPairString;
421     QMap<int, QPairString> protocols;
422 #define P(value,name,dsc) do { protocols[value] = QPairString( QString(dsc), QString(name) );} while(0)
423     P( NO_PROTO,    "",         "" );
424     P( UDPM_PROTO,  "udp",      "UDP/RTP (multicast)" );
425     P( HTTP_PROTO,  "http",     "HTTP" );
426     P( HTTPS_PROTO, "https",    "HTTPS" );
427     P( MMS_PROTO,   "mms",      "MMS" );
428     P( FTP_PROTO,   "ftp",      "FTP" );
429     P( RTSP_PROTO,  "rtsp",     "RTSP" );
430     P( UDP_PROTO,   "udp",      "UDP/RTP (unicast)" );
431     P( RTMP_PROTO,  "rtmp",     "RTMP" );
432 #undef P
433     foreach( QPairString e, protocols ) /* Sorted by key, exactly what we need */
434         ui.protocolCombo->addItem( e.first, QVariant(e.second.isEmpty() ) );
435 }
436
437 NetOpenPanel::~NetOpenPanel()
438 {}
439
440 void NetOpenPanel::clear()
441 {}
442
443 /* update the widgets according the type of protocol */
444 void NetOpenPanel::updateProtocol( int idx_proto ) {
445     QString addr = ui.addressText->text();
446     QString proto = ui.protocolCombo->itemData( idx_proto ).toString();
447
448     ui.timeShift->setEnabled( idx_proto == UDP_PROTO ||
449                               idx_proto == UDPM_PROTO );
450     ui.ipv6->setEnabled( idx_proto == UDP_PROTO );
451     ui.addressText->setEnabled( idx_proto != UDP_PROTO );
452     ui.portSpin->setEnabled( idx_proto == UDP_PROTO ||
453                              idx_proto == UDPM_PROTO );
454
455     if( idx_proto == NO_PROTO ) return;
456
457     /* If we already have a protocol in the address, replace it */
458     if( addr.contains( "://"))
459     {
460         if( idx_proto != UDPM_PROTO )
461             addr.replace( QRegExp("^.*://@*"), proto + "://");
462         else
463              addr.replace( QRegExp("^.*://"), proto + "://@");
464         ui.addressText->setText( addr );
465     }
466     updateMRL();
467 }
468
469 void NetOpenPanel::updateMRL() {
470     QString mrl = "";
471     QString addr = ui.addressText->text();
472     addr = QUrl::toPercentEncoding( addr, ":/?#@!$&'()*+,;=" );
473     int idx_proto = ui.protocolCombo->currentIndex();
474
475     if( addr.contains( "://"))
476     {
477         /* Match the correct item in the comboBox */
478         ui.protocolCombo->setCurrentIndex(
479                 ui.protocolCombo->findData( addr.section( ':', 0, 0 ) ) );
480
481         if( idx_proto != UDP_PROTO || idx_proto != UDPM_PROTO )
482             mrl = addr;
483     }
484     else
485     {
486         switch( idx_proto ) {
487         case HTTP_PROTO:
488             mrl = "http://" + addr;
489             emit methodChanged("http-caching");
490             break;
491         case HTTPS_PROTO:
492             mrl = "https://" + addr;
493             emit methodChanged("http-caching");
494             break;
495         case MMS_PROTO:
496             mrl = "mms://" + addr;
497             emit methodChanged("mms-caching");
498             break;
499         case FTP_PROTO:
500             mrl = "ftp://" + addr;
501             emit methodChanged("ftp-caching");
502             break;
503         case RTSP_PROTO:
504             mrl = "rtsp://" + addr;
505             emit methodChanged("rtsp-caching");
506             break;
507         case UDP_PROTO:
508             mrl = "udp://@";
509             if( ui.ipv6->isEnabled() && ui.ipv6->isChecked() )
510             {
511                 mrl += "[::]";
512             }
513             mrl += QString(":%1").arg( ui.portSpin->value() );
514             emit methodChanged("udp-caching");
515             break;
516         case UDPM_PROTO: /* UDP multicast */
517             mrl = "udp://@";
518             /* Add [] to IPv6 */
519             if ( addr.contains(':') && !addr.contains('[') )
520             {
521                 mrl += "[" + addr + "]";
522             }
523             else mrl += addr;
524             mrl += QString(":%1").arg( ui.portSpin->value() );
525             emit methodChanged("udp-caching");
526             break;
527         case RTMP_PROTO:
528             mrl = "rtmp://" + addr;
529             emit methodChanged("rtmp-caching");
530             break;
531
532         }
533     }
534
535     // Encode the boring stuffs
536
537     if( ui.timeShift->isEnabled() && ui.timeShift->isChecked() ) {
538         mrl += " :access-filter=timeshift";
539     }
540     emit mrlUpdated( mrl );
541 }
542
543 /**************************************************************************
544  * Open Capture device ( DVB, PVR, V4L, and similar )                     *
545  **************************************************************************/
546 CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
547                                 OpenPanel( _parent, _p_intf )
548 {
549     ui.setupUi( this );
550
551     BUTTONACT( ui.advancedButton, advancedDialog() );
552
553     /* Create two stacked layouts in the main comboBoxes */
554     QStackedLayout *stackedDevLayout = new QStackedLayout;
555     ui.cardBox->setLayout( stackedDevLayout );
556
557     QStackedLayout *stackedPropLayout = new QStackedLayout;
558     ui.optionsBox->setLayout( stackedPropLayout );
559
560     /* Creation and connections of the WIdgets in the stacked layout */
561 #define addModuleAndLayouts( number, name, label )                    \
562     QWidget * name ## DevPage = new QWidget( this );                  \
563     QWidget * name ## PropPage = new QWidget( this );                 \
564     stackedDevLayout->addWidget( name ## DevPage );        \
565     stackedPropLayout->addWidget( name ## PropPage );      \
566     QGridLayout * name ## DevLayout = new QGridLayout;                \
567     QGridLayout * name ## PropLayout = new QGridLayout;               \
568     name ## DevPage->setLayout( name ## DevLayout );                  \
569     name ## PropPage->setLayout( name ## PropLayout );                \
570     ui.deviceCombo->addItem( qtr( label ), QVariant( number ) );
571
572 #define CuMRL( widget, slot ) CONNECT( widget , slot , this, updateMRL() );
573
574 #ifdef WIN32
575     /*********************
576      * DirectShow Stuffs *
577      *********************/
578     if( module_Exists( p_intf, "dshow" ) ){
579     addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow" );
580
581     /* dshow Main */
582     int line = 0;
583     module_config_t *p_config =
584         config_FindConfig( VLC_OBJECT(p_intf), "dshow-vdev" );
585     vdevDshowW = new StringListConfigControl(
586         VLC_OBJECT(p_intf), p_config, this, false, dshowDevLayout, line );
587     line++;
588
589     p_config = config_FindConfig( VLC_OBJECT(p_intf), "dshow-adev" );
590     adevDshowW = new StringListConfigControl(
591         VLC_OBJECT(p_intf), p_config, this, false, dshowDevLayout, line );
592     line++;
593
594     /* dshow Properties */
595     QLabel *dshowVSizeLabel = new QLabel( qtr( "Video size" ) );
596     dshowPropLayout->addWidget( dshowVSizeLabel, 0, 0 );
597
598     dshowVSizeLine = new QLineEdit;
599     dshowPropLayout->addWidget( dshowVSizeLine, 0, 1);
600     dshowPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
601             1, 0, 3, 1 );
602
603     /* dshow CONNECTs */
604     CuMRL( vdevDshowW->combo, currentIndexChanged ( int ) );
605     CuMRL( adevDshowW->combo, currentIndexChanged ( int ) );
606     CuMRL( dshowVSizeLine, textChanged( QString ) );
607     }
608
609     /**************
610      * BDA Stuffs *
611      **************/
612     if( module_Exists( p_intf, "bda" ) ){
613     addModuleAndLayouts( BDA_DEVICE, bda, "DVB DirectShow" );
614
615     /* bda Main */
616     QLabel *bdaTypeLabel = new QLabel( qtr( "DVB Type:" ) );
617
618     bdas = new QRadioButton( "DVB-S" );
619     bdas->setChecked( true );
620     bdac = new QRadioButton( "DVB-C" );
621     bdat = new QRadioButton( "DVB-T" );
622
623     bdaDevLayout->addWidget( bdaTypeLabel, 0, 0 );
624     bdaDevLayout->addWidget( bdas, 0, 1 );
625     bdaDevLayout->addWidget( bdac, 0, 2 );
626     bdaDevLayout->addWidget( bdat, 0, 3 );
627
628     /* bda Props */
629     QLabel *bdaFreqLabel =
630                     new QLabel( qtr( "Transponder/multiplex frequency" ) );
631     bdaPropLayout->addWidget( bdaFreqLabel, 0, 0 );
632
633     bdaFreq = new QSpinBox;
634     bdaFreq->setAlignment( Qt::AlignRight );
635     bdaFreq->setSuffix(" kHz");
636     bdaFreq->setSingleStep( 1000 );
637     setSpinBoxFreq( bdaFreq )
638     bdaPropLayout->addWidget( bdaFreq, 0, 1 );
639
640     bdaSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
641     bdaPropLayout->addWidget( bdaSrateLabel, 1, 0 );
642
643     bdaSrate = new QSpinBox;
644     bdaSrate->setAlignment( Qt::AlignRight );
645     bdaSrate->setSuffix(" kHz");
646     setSpinBoxFreq( bdaSrate );
647     bdaPropLayout->addWidget( bdaSrate, 1, 1 );
648
649     bdaBandLabel = new QLabel( qtr( "Bandwidth" ) );
650     bdaPropLayout->addWidget( bdaBandLabel, 2, 0 );
651
652     bdaBandBox = new QComboBox;
653     setfillVLCConfigCombo( "dvb-bandwidth", p_intf, bdaBandBox );
654     bdaPropLayout->addWidget( bdaBandBox, 2, 1 );
655
656     bdaBandLabel->hide();
657     bdaBandBox->hide();
658     bdaPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
659             2, 0, 2, 1 );
660
661     /* bda CONNECTs */
662     CuMRL( bdaFreq, valueChanged ( int ) );
663     CuMRL( bdaSrate, valueChanged ( int ) );
664     CuMRL( bdaBandBox,  currentIndexChanged ( int ) );
665     BUTTONACT( bdas, updateButtons() );
666     BUTTONACT( bdat, updateButtons() );
667     BUTTONACT( bdac, updateButtons() );
668     BUTTONACT( bdas, updateMRL() );
669     BUTTONACT( bdat, updateMRL() );
670     BUTTONACT( bdac, updateMRL() );
671     }
672
673 #else /* WIN32 */
674     /*******
675      * V4L2*
676      *******/
677     if( module_Exists( p_intf, "v4l2" ) ){
678     addModuleAndLayouts( V4L2_DEVICE, v4l2, "Video for Linux 2" );
679
680     /* V4l Main panel */
681     QLabel *v4l2VideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
682     v4l2DevLayout->addWidget( v4l2VideoDeviceLabel, 0, 0 );
683
684     v4l2VideoDevice = new QLineEdit;
685     v4l2DevLayout->addWidget( v4l2VideoDevice, 0, 1 );
686
687     QLabel *v4l2AudioDeviceLabel = new QLabel( qtr( "Audio device name" ) );
688     v4l2DevLayout->addWidget( v4l2AudioDeviceLabel, 1, 0 );
689
690     v4l2AudioDevice = new QLineEdit;
691     v4l2DevLayout->addWidget( v4l2AudioDevice, 1, 1 );
692
693     /* v4l2 Props panel */
694     QLabel *v4l2StdLabel = new QLabel( qtr( "Standard" ) );
695     v4l2PropLayout->addWidget( v4l2StdLabel, 0 , 0 );
696
697     v4l2StdBox = new QComboBox;
698     setfillVLCConfigCombo( "v4l2-standard", p_intf, v4l2StdBox );
699     v4l2PropLayout->addWidget( v4l2StdBox, 0 , 1 );
700     v4l2PropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
701             1, 0, 3, 1 );
702
703     /* v4l2 CONNECTs */
704     CuMRL( v4l2VideoDevice, textChanged( QString ) );
705     CuMRL( v4l2AudioDevice, textChanged( QString ) );
706     CuMRL( v4l2StdBox,  currentIndexChanged ( int ) );
707     }
708
709     /*******
710      * V4L *
711      *******/
712     if( module_Exists( p_intf, "v4l" ) ){
713     addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux" );
714
715     /* V4l Main panel */
716     QLabel *v4lVideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
717     v4lDevLayout->addWidget( v4lVideoDeviceLabel, 0, 0 );
718
719     v4lVideoDevice = new QLineEdit;
720     v4lDevLayout->addWidget( v4lVideoDevice, 0, 1 );
721
722     QLabel *v4lAudioDeviceLabel = new QLabel( qtr( "Audio device name" ) );
723     v4lDevLayout->addWidget( v4lAudioDeviceLabel, 1, 0 );
724
725     v4lAudioDevice = new QLineEdit;
726     v4lDevLayout->addWidget( v4lAudioDevice, 1, 1 );
727
728     /* V4l Props panel */
729     QLabel *v4lNormLabel = new QLabel( qtr( "Norm" ) );
730     v4lPropLayout->addWidget( v4lNormLabel, 0 , 0 );
731
732     v4lNormBox = new QComboBox;
733     setfillVLCConfigCombo( "v4l-norm", p_intf, v4lNormBox );
734     v4lPropLayout->addWidget( v4lNormBox, 0 , 1 );
735
736     QLabel *v4lFreqLabel = new QLabel( qtr( "Frequency" ) );
737     v4lPropLayout->addWidget( v4lFreqLabel, 1 , 0 );
738
739     v4lFreq = new QSpinBox;
740     v4lFreq->setAlignment( Qt::AlignRight );
741     v4lFreq->setSuffix(" kHz");
742     setSpinBoxFreq( v4lFreq );
743     v4lPropLayout->addWidget( v4lFreq, 1 , 1 );
744     v4lPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
745             2, 0, 2, 1 );
746
747     /* v4l CONNECTs */
748     CuMRL( v4lVideoDevice, textChanged( QString ) );
749     CuMRL( v4lAudioDevice, textChanged( QString ) );
750     CuMRL( v4lFreq, valueChanged ( int ) );
751     CuMRL( v4lNormBox,  currentIndexChanged ( int ) );
752     }
753
754     /*******
755      * JACK *
756      *******/
757     if( module_Exists( p_intf, "jack" ) ){
758     addModuleAndLayouts( JACK_DEVICE, jack, "JACK Audio Connection Kit" );
759
760     /* Jack Main panel */
761     /* Channels */
762     QLabel *jackChannelsLabel = new QLabel( qtr( "Channels:" ) );
763     jackDevLayout->addWidget( jackChannelsLabel, 1, 0 );
764
765     jackChannels = new QSpinBox;
766     setSpinBoxFreq( jackChannels );
767     jackChannels->setMaximum(255);
768     jackChannels->setValue(2);
769     jackChannels->setAlignment( Qt::AlignRight );
770     jackDevLayout->addWidget( jackChannels, 1, 1 );
771
772     /* Jack Props panel */
773
774     /* Selected ports */
775     QLabel *jackPortsLabel = new QLabel( qtr( "Selected ports:" ) );
776     jackPropLayout->addWidget( jackPortsLabel, 0 , 0 );
777
778     jackPortsSelected = new QLineEdit( qtr( ".*") );
779     jackPortsSelected->setAlignment( Qt::AlignRight );
780     jackPropLayout->addWidget( jackPortsSelected, 0, 1 );
781
782     /* Caching */
783     QLabel *jackCachingLabel = new QLabel( qtr( "Input caching:" ) );
784     jackPropLayout->addWidget( jackCachingLabel, 1 , 0 );
785     jackCaching = new QSpinBox;
786     setSpinBoxFreq( jackCaching );
787     jackCaching->setSuffix( " ms" );
788     jackCaching->setValue(1000);
789     jackCaching->setAlignment( Qt::AlignRight );
790     jackPropLayout->addWidget( jackCaching, 1 , 1 );
791
792     /* Pace */
793     jackPace = new QCheckBox(qtr( "Use VLC pace" ));
794     jackPropLayout->addWidget( jackPace, 2, 1 );
795
796     /* Auto Connect */
797     jackConnect = new QCheckBox( qtr( "Auto connnection" ));
798     jackPropLayout->addWidget( jackConnect, 3, 1 );
799
800     /* Jack CONNECTs */
801     CuMRL( jackChannels, valueChanged( int ) );
802     CuMRL( jackCaching, valueChanged( int ) );
803     CuMRL( jackPace, stateChanged( int ) );
804     CuMRL( jackConnect, stateChanged( int ) );
805     CuMRL( jackPortsSelected, textChanged( QString ) );
806     }
807
808     /************
809      * PVR      *
810      ************/
811     if( module_Exists( p_intf, "pvr" ) ){
812     addModuleAndLayouts( PVR_DEVICE, pvr, "PVR" );
813
814     /* PVR Main panel */
815     QLabel *pvrDeviceLabel = new QLabel( qtr( "Device name" ) );
816     pvrDevLayout->addWidget( pvrDeviceLabel, 0, 0 );
817
818     pvrDevice = new QLineEdit;
819     pvrDevLayout->addWidget( pvrDevice, 0, 1 );
820
821     QLabel *pvrRadioDeviceLabel = new QLabel( qtr( "Radio device name" ) );
822     pvrDevLayout->addWidget( pvrRadioDeviceLabel, 1, 0 );
823
824     pvrRadioDevice = new QLineEdit;
825     pvrDevLayout->addWidget( pvrRadioDevice, 1, 1 );
826
827     /* PVR props panel */
828     QLabel *pvrNormLabel = new QLabel( qtr( "Norm" ) );
829     pvrPropLayout->addWidget( pvrNormLabel, 0, 0 );
830
831     pvrNormBox = new QComboBox;
832     setfillVLCConfigCombo( "pvr-norm", p_intf, pvrNormBox );
833     pvrPropLayout->addWidget( pvrNormBox, 0, 1 );
834
835     QLabel *pvrFreqLabel = new QLabel( qtr( "Frequency" ) );
836     pvrPropLayout->addWidget( pvrFreqLabel, 1, 0 );
837
838     pvrFreq = new QSpinBox;
839     pvrFreq->setAlignment( Qt::AlignRight );
840     pvrFreq->setSuffix(" kHz");
841     setSpinBoxFreq( pvrFreq );
842     pvrPropLayout->addWidget( pvrFreq, 1, 1 );
843
844     QLabel *pvrBitrLabel = new QLabel( qtr( "Bitrate" ) );
845     pvrPropLayout->addWidget( pvrBitrLabel, 2, 0 );
846
847     pvrBitr = new QSpinBox;
848     pvrBitr->setAlignment( Qt::AlignRight );
849     pvrBitr->setSuffix(" kHz");
850     setSpinBoxFreq( pvrBitr );
851     pvrPropLayout->addWidget( pvrBitr, 2, 1 );
852     pvrPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
853             3, 0, 1, 1 );
854
855     /* PVR CONNECTs */
856     CuMRL( pvrDevice, textChanged( QString ) );
857     CuMRL( pvrRadioDevice, textChanged( QString ) );
858
859     CuMRL( pvrFreq, valueChanged ( int ) );
860     CuMRL( pvrBitr, valueChanged ( int ) );
861     CuMRL( pvrNormBox, currentIndexChanged ( int ) );
862     }
863
864     /**************
865      * DVB Stuffs *
866      **************/
867     if( module_Exists( p_intf, "dvb" ) ){
868     addModuleAndLayouts( DVB_DEVICE, dvb, "DVB" );
869
870     /* DVB Main */
871     QLabel *dvbDeviceLabel = new QLabel( qtr( "Adapter card to tune" ) );
872     QLabel *dvbTypeLabel = new QLabel( qtr( "DVB Type:" ) );
873
874     dvbCard = new QSpinBox;
875     dvbCard->setAlignment( Qt::AlignRight );
876     dvbCard->setPrefix( "/dev/dvb/adapter" );
877
878     dvbDevLayout->addWidget( dvbDeviceLabel, 0, 0 );
879     dvbDevLayout->addWidget( dvbCard, 0, 2, 1, 2 );
880
881     dvbs = new QRadioButton( "DVB-S" );
882     dvbs->setChecked( true );
883     dvbc = new QRadioButton( "DVB-C" );
884     dvbt = new QRadioButton( "DVB-T" );
885
886     dvbDevLayout->addWidget( dvbTypeLabel, 1, 0 );
887     dvbDevLayout->addWidget( dvbs, 1, 1 );
888     dvbDevLayout->addWidget( dvbc, 1, 2 );
889     dvbDevLayout->addWidget( dvbt, 1, 3 );
890
891     /* DVB Props panel */
892     QLabel *dvbFreqLabel =
893                     new QLabel( qtr( "Transponder/multiplex frequency" ) );
894     dvbPropLayout->addWidget( dvbFreqLabel, 0, 0 );
895
896     dvbFreq = new QSpinBox;
897     dvbFreq->setAlignment( Qt::AlignRight );
898     dvbFreq->setSuffix(" kHz");
899     setSpinBoxFreq( dvbFreq  );
900     dvbPropLayout->addWidget( dvbFreq, 0, 1 );
901
902     QLabel *dvbSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
903     dvbPropLayout->addWidget( dvbSrateLabel, 1, 0 );
904
905     dvbSrate = new QSpinBox;
906     dvbSrate->setAlignment( Qt::AlignRight );
907     dvbSrate->setSuffix(" kHz");
908     setSpinBoxFreq( dvbSrate );
909     dvbPropLayout->addWidget( dvbSrate, 1, 1 );
910     dvbPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
911             2, 0, 2, 1 );
912
913     /* DVB CONNECTs */
914     CuMRL( dvbCard, valueChanged ( int ) );
915     CuMRL( dvbFreq, valueChanged ( int ) );
916     CuMRL( dvbSrate, valueChanged ( int ) );
917
918     BUTTONACT( dvbs, updateButtons() );
919     BUTTONACT( dvbt, updateButtons() );
920     BUTTONACT( dvbc, updateButtons() );
921     }
922
923 #endif
924
925
926     /**********
927      * Screen *
928      **********/
929     addModuleAndLayouts( SCREEN_DEVICE, screen, "Desktop" );
930     QLabel *screenLabel = new QLabel( "This option will open your own "
931             "desktop in order to save or stream it.");
932     screenLabel->setWordWrap( true );
933     screenDevLayout->addWidget( screenLabel, 0, 0 );
934
935     /* General connects */
936     CONNECT( ui.deviceCombo, activated( int ) ,
937              stackedDevLayout, setCurrentIndex( int ) );
938     CONNECT( ui.deviceCombo, activated( int ),
939              stackedPropLayout, setCurrentIndex( int ) );
940     CONNECT( ui.deviceCombo, activated( int ), this, updateMRL() );
941     CONNECT( ui.deviceCombo, activated( int ), this, updateButtons() );
942
943 #undef addModule
944 }
945
946 CaptureOpenPanel::~CaptureOpenPanel()
947 {
948 }
949
950 void CaptureOpenPanel::clear()
951 {
952     advMRL.clear();
953 }
954
955 void CaptureOpenPanel::updateMRL()
956 {
957     QString mrl = "";
958     int i_devicetype = ui.deviceCombo->itemData(
959             ui.deviceCombo->currentIndex() ).toInt();
960     switch( i_devicetype )
961     {
962 #ifdef WIN32
963     case BDA_DEVICE:
964         if( bdas->isChecked() ) mrl = "dvb-s://";
965         else if(  bdat->isChecked() ) mrl = "dvb-t://";
966         else if(  bdac->isChecked() ) mrl = "dvb-c://";
967         else return;
968         mrl += " :dvb-frequency=" + QString("%1").arg( bdaFreq->value() );
969         if( bdas->isChecked() || bdac->isChecked() )
970             mrl += " :dvb-srate=" + QString("%1").arg( bdaSrate->value() );
971         else
972             mrl += " :dvb-bandwidth=" +
973                 QString("%1").arg( bdaBandBox->itemData(
974                     bdaBandBox->currentIndex() ).toInt() );
975         break;
976     case DSHOW_DEVICE:
977         mrl = "dshow://";
978         mrl+= " :dshow-vdev=" + QString("\"%1\"").arg( vdevDshowW->getValue() );
979         mrl+= " :dshow-adev=" + QString("\"%1\"").arg( adevDshowW->getValue() );
980         if( dshowVSizeLine->isModified() )
981             mrl += " :dshow-size=" + dshowVSizeLine->text();
982         break;
983 #else
984     case V4L_DEVICE:
985         mrl = "v4l://";
986         mrl += " :v4l-vdev=" + v4lVideoDevice->text();
987         mrl += " :v4l-adev=" + v4lAudioDevice->text();
988         mrl += " :v4l-norm=" + QString("%1").arg( v4lNormBox->currentIndex() );
989         mrl += " :v4l-frequency=" + QString("%1").arg( v4lFreq->value() );
990         break;
991     case V4L2_DEVICE:
992         mrl = "v4l2://";
993         mrl += " :v4l2-dev=" + v4l2VideoDevice->text();
994         mrl += " :v4l2-adev=" + v4l2AudioDevice->text();
995         mrl += " :v4l2-standard=" + QString("%1").arg( v4l2StdBox->currentIndex() );
996         break;
997     case JACK_DEVICE:
998         mrl = "jack://";
999         mrl += "channels=" + QString("%1").arg( jackChannels->value() );
1000         mrl += ":ports=" + jackPortsSelected->text();
1001         mrl += " --jack-input-caching=" + QString("%1").arg( jackCaching->value() );
1002         if ( jackPace->isChecked() )
1003         {
1004                 mrl += " --jack-input-use-vlc-pace";
1005         }
1006         if ( jackConnect->isChecked() )
1007         {
1008                 mrl += " --jack-input-auto-connect";
1009         }
1010         break;
1011     case PVR_DEVICE:
1012         mrl = "pvr://";
1013         mrl += " :pvr-device=" + pvrDevice->text();
1014         mrl += " :pvr-radio-device=" + pvrRadioDevice->text();
1015         mrl += " :pvr-norm=" + QString("%1").arg( pvrNormBox->currentIndex() );
1016         if( pvrFreq->value() )
1017             mrl += " :pvr-frequency=" + QString("%1").arg( pvrFreq->value() );
1018         if( pvrBitr->value() )
1019             mrl += " :pvr-bitrate=" + QString("%1").arg( pvrBitr->value() );
1020         break;
1021     case DVB_DEVICE:
1022         mrl = "dvb://";
1023         mrl += " :dvb-adapter=" + QString("%1").arg( dvbCard->value() );
1024         mrl += " :dvb-frequency=" + QString("%1").arg( dvbFreq->value() );
1025         mrl += " :dvb-srate=" + QString("%1").arg( dvbSrate->value() );
1026         break;
1027 #endif
1028     case SCREEN_DEVICE:
1029         mrl = "screen://";
1030         updateButtons();
1031         break;
1032     }
1033
1034     if( !advMRL.isEmpty() ) mrl += advMRL;
1035
1036     emit mrlUpdated( mrl );
1037 }
1038
1039 /**
1040  * Update the Buttons (show/hide) for the GUI as all device type don't
1041  * use the same ui. elements.
1042  **/
1043 void CaptureOpenPanel::updateButtons()
1044 {
1045     /*  Be sure to display the ui Elements in case they were hidden by
1046      *  some Device Type (like Screen://) */
1047     ui.optionsBox->show();
1048     ui.advancedButton->show();
1049     /* Get the current Device Number */
1050     int i_devicetype = ui.deviceCombo->itemData(
1051                                 ui.deviceCombo->currentIndex() ).toInt();
1052     switch( i_devicetype )
1053     {
1054 #ifdef WIN32
1055     case BDA_DEVICE:
1056         if( bdas->isChecked() || bdac->isChecked() )
1057         {
1058             bdaSrate->show();
1059             bdaSrateLabel->show();
1060             bdaBandBox->hide();
1061             bdaBandLabel->hide();
1062         }
1063         else
1064         {
1065             bdaSrate->hide();
1066             bdaSrateLabel->hide();
1067             bdaBandBox->show();
1068             bdaBandLabel->show();
1069         }
1070         break;
1071 #else
1072     case DVB_DEVICE:
1073         if( dvbs->isChecked() ) dvbFreq->setSuffix(" kHz");
1074         if( dvbc->isChecked() || dvbt->isChecked() ) dvbFreq->setSuffix(" Hz");
1075         break;
1076 #endif
1077     case SCREEN_DEVICE:
1078         ui.optionsBox->hide();
1079         ui.advancedButton->hide();
1080         break;
1081     }
1082
1083     advMRL.clear();
1084 }
1085
1086 void CaptureOpenPanel::advancedDialog()
1087 {
1088     /* Get selected device type */
1089     int i_devicetype = ui.deviceCombo->itemData(
1090                                 ui.deviceCombo->currentIndex() ).toInt();
1091
1092     /* Get the corresponding module */
1093     module_t *p_module =
1094         module_Find( VLC_OBJECT(p_intf), psz_devModule[i_devicetype] );
1095     if( NULL == p_module ) return;
1096
1097     /* Init */
1098     QList<ConfigControl *> controls;
1099
1100     /* Get the confsize  */
1101     unsigned int i_confsize;
1102     module_config_t *p_config;
1103     p_config = module_GetConfig( p_module, &i_confsize );
1104
1105     /* New Adv Prop dialog */
1106     adv = new QDialog( this );
1107     adv->setWindowTitle( qtr( "Advanced options..." ) );
1108
1109     /* A main Layout with a Frame */
1110     QVBoxLayout *mainLayout = new QVBoxLayout( adv );
1111     QFrame *advFrame = new QFrame;
1112     QScrollArea *scroll = new QScrollArea;
1113     mainLayout->addWidget( scroll );
1114
1115     /* GridLayout inside the Frame */
1116     QGridLayout *gLayout = new QGridLayout( advFrame );
1117     gLayout->setSizeConstraint( QLayout::SetFixedSize );
1118
1119     scroll->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
1120     scroll->setWidgetResizable( true );
1121     scroll->setWidget( advFrame );
1122
1123     /* Create the options inside the FrameLayout */
1124     for( int n = 0; n < i_confsize; n++ )
1125     {
1126         module_config_t *p_item = p_config + n;
1127         ConfigControl *config = ConfigControl::createControl(
1128                         VLC_OBJECT( p_intf ), p_item, advFrame, gLayout, n );
1129         controls.append( config );
1130     }
1131
1132     /* Button stuffs */
1133     QDialogButtonBox *advButtonBox = new QDialogButtonBox( adv );
1134     QPushButton *closeButton = new QPushButton( qtr( "Ok" ) );
1135     QPushButton *cancelButton = new QPushButton( qtr( "Cancel" ) );
1136
1137     CONNECT( closeButton, clicked(), adv, accept() );
1138     CONNECT( cancelButton, clicked(), adv, reject() );
1139
1140     advButtonBox->addButton( closeButton, QDialogButtonBox::AcceptRole );
1141     advButtonBox->addButton( cancelButton, QDialogButtonBox::RejectRole );
1142
1143     mainLayout->addWidget( advButtonBox );
1144
1145     /* Creation of the MRL */
1146     if( adv->exec() )
1147     {
1148         QString tempMRL = "";
1149         for( int i = 0; i < controls.size(); i++ )
1150         {
1151             ConfigControl *control = controls[i];
1152             if( !control )
1153             {
1154                 msg_Dbg( p_intf, "This shouldn't happen, please report" );
1155                 continue;
1156             }
1157
1158             tempMRL += (i ? " :" : ":");
1159
1160             if( control->getType() == CONFIG_ITEM_BOOL )
1161                 if( !(qobject_cast<VIntConfigControl *>(control)->getValue() ) )
1162                     tempMRL += "no-";
1163
1164             tempMRL += control->getName();
1165
1166             switch( control->getType() )
1167             {
1168                 case CONFIG_ITEM_STRING:
1169                 case CONFIG_ITEM_FILE:
1170                 case CONFIG_ITEM_DIRECTORY:
1171                 case CONFIG_ITEM_MODULE:
1172                     tempMRL += QString("=\"%1\"").arg( qobject_cast<VStringConfigControl *>(control)->getValue() );
1173                     break;
1174                 case CONFIG_ITEM_INTEGER:
1175                     tempMRL += QString("=%1").arg( qobject_cast<VIntConfigControl *>(control)->getValue() );
1176                     break;
1177                 case CONFIG_ITEM_FLOAT:
1178                     tempMRL += QString("=%1").arg( qobject_cast<VFloatConfigControl *>(control)->getValue() );
1179                     break;
1180             }
1181         }
1182         advMRL = tempMRL;
1183         updateMRL();
1184         msg_Dbg( p_intf, "%s", qtu( advMRL ) );
1185     }
1186     delete adv;
1187 }
1188