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