1 /*****************************************************************************
2 * open.cpp : Panels for the open dialogs
3 ****************************************************************************
4 * Copyright (C) 2006-2009 the VideoLAN team
5 * Copyright (C) 2007 Société des arts technologiques
6 * Copyright (C) 2007 Savoir-faire Linux
10 * Authors: Clément Stenac <zorglub@videolan.org>
11 * Jean-Baptiste Kempf <jb@videolan.org>
12 * Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
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.
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.
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 *****************************************************************************/
34 #include "components/open_panels.hpp"
35 #include "dialogs/open.hpp"
36 #include "dialogs_provider.hpp" /* Open Subtitle file */
37 #include "util/qt_dirs.hpp"
39 #include <QFileDialog>
40 #include <QDialogButtonBox>
42 #include <QStackedLayout>
46 #include <QScrollArea>
48 #include <QStringListModel>
50 #define I_DEVICE_TOOLTIP N_("Select the device or the VIDEO_TS directory")
52 static const char *psz_devModule[] = { "v4l", "v4l2", "pvr", "dvb", "bda",
53 "dshow", "screen", "jack" };
55 /**************************************************************************
56 * Open Files and subtitles *
57 **************************************************************************/
58 FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
59 OpenPanel( _parent, _p_intf ), dialogBox( NULL )
61 /* Classic UI Setup */
64 /* Set Filters for file selection */
65 /* QString fileTypes = "";
66 ADD_FILTER_MEDIA( fileTypes );
67 ADD_FILTER_VIDEO( fileTypes );
68 ADD_FILTER_AUDIO( fileTypes );
69 ADD_FILTER_PLAYLIST( fileTypes );
70 ADD_FILTER_ALL( fileTypes );
71 fileTypes.replace( QString(";*"), QString(" *")); */
74 /* lineFileEdit = ui.fileEdit;
75 //TODO later: fill the fileCompleteList with previous items played.
76 QCompleter *fileCompleter = new QCompleter( fileCompleteList, this );
77 fileCompleter->setModel( new QDirModel( fileCompleter ) );
78 lineFileEdit->setCompleter( fileCompleter );*/
79 if( config_GetInt( p_intf, "qt-embedded-open" ) )
81 ui.tempWidget->hide();
86 /* Deactivate the subtitles control by default. */
87 ui.subFrame->setEnabled( false );
88 /* Build the subs size combo box */
89 setfillVLCConfigCombo( "freetype-rel-fontsize" , p_intf,
91 /* Build the subs align combo box */
92 setfillVLCConfigCombo( "subsdec-align", p_intf, ui.alignSubComboBox );
95 BUTTONACT( ui.fileBrowseButton, browseFile() );
96 BUTTONACT( ui.delFileButton, deleteFile() );
98 BUTTONACT( ui.subBrowseButton, browseFileSub() );
99 CONNECT( ui.subCheckBox, toggled( bool ), this, toggleSubtitleFrame( bool ) );
101 CONNECT( ui.fileListWidg, itemChanged( QListWidgetItem * ), this, updateMRL() );
102 CONNECT( ui.subInput, textChanged( const QString& ), this, updateMRL() );
103 CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this, updateMRL() );
104 CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this, updateMRL() );
107 inline void FileOpenPanel::BuildOldPanel()
109 /** BEGIN QFileDialog tweaking **/
110 /* Use a QFileDialog and customize it because we don't want to
111 rewrite it all. Be careful to your eyes cause there are a few hacks.
112 Be very careful and test correctly when you modify this. */
114 /* Make this QFileDialog a child of tempWidget from the ui. */
115 dialogBox = new FileOpenBox( ui.tempWidget, NULL,
116 p_intf->p_sys->filepath, "" );
118 dialogBox->setFileMode( QFileDialog::ExistingFiles );
119 dialogBox->setAcceptMode( QFileDialog::AcceptOpen );
120 dialogBox->restoreState(
121 getSettings()->value( "file-dialog-state" ).toByteArray() );
123 /* We don't want to see a grip in the middle of the window, do we? */
124 dialogBox->setSizeGripEnabled( false );
127 dialogBox->setToolTip( qtr( "Select one or multiple files" ) );
128 dialogBox->setMinimumHeight( 250 );
130 // But hide the two OK/Cancel buttons. Enable them for debug.
131 QDialogButtonBox *fileDialogAcceptBox =
132 dialogBox->findChildren<QDialogButtonBox*>()[0];
133 fileDialogAcceptBox->hide();
135 /* Ugly hacks to get the good Widget */
136 //This lineEdit is the normal line in the fileDialog.
137 QLineEdit *lineFileEdit = dialogBox->findChildren<QLineEdit*>()[0];
138 /* Make a list of QLabel inside the QFileDialog to access the good ones */
139 QList<QLabel *> listLabel = dialogBox->findChildren<QLabel*>();
141 /* Hide the FileNames one. Enable it for debug */
142 listLabel[1]->setText( qtr( "File names:" ) );
143 /* Change the text that was uncool in the usual box */
144 listLabel[2]->setText( qtr( "Filter:" ) );
146 dialogBox->layout()->setMargin( 0 );
147 dialogBox->layout()->setSizeConstraint( QLayout::SetNoConstraint );
149 /** END of QFileDialog tweaking **/
151 // Add the DialogBox to the layout
152 ui.gridLayout->addWidget( dialogBox, 0, 0, 1, 3 );
154 CONNECT( lineFileEdit, textChanged( const QString& ), this, updateMRL() );
155 dialogBox->installEventFilter( this );
158 FileOpenPanel::~FileOpenPanel()
161 getSettings()->setValue( "file-dialog-state", dialogBox->saveState() );
164 void FileOpenPanel::browseFile()
166 QStringList files = QFileDialog::getOpenFileNames( this );
167 foreach( const QString &file, files)
169 QListWidgetItem *item = new QListWidgetItem( file, ui.fileListWidg );
170 item->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled );
171 ui.fileListWidg->addItem( item );
176 void FileOpenPanel::deleteFile()
178 int i = ui.fileListWidg->currentRow();
181 QListWidgetItem *temp = ui.fileListWidg->takeItem( i );
188 /* Show a fileBrowser to select a subtitle */
189 void FileOpenPanel::browseFileSub()
191 // TODO Handle selection of more than one subtitles file
192 QStringList files = THEDP->showSimpleOpen( qtr("Open subtitles file"),
193 EXT_FILTER_SUBTITLE, p_intf->p_sys->filepath );
195 if( files.isEmpty() ) return;
196 ui.subInput->setText( files.join(" ") );
200 void FileOpenPanel::toggleSubtitleFrame( bool b )
202 ui.subFrame->setEnabled( b );
209 /* Update the current MRL */
210 void FileOpenPanel::updateMRL()
212 QStringList fileList;
216 if( dialogBox == NULL )
217 for( int i = 0; i < ui.fileListWidg->count(); i++ )
219 if( !ui.fileListWidg->item( i )->text().isEmpty() )
220 fileList << ui.fileListWidg->item( i )->text();
223 fileList = dialogBox->selectedFiles();
226 if( ui.subCheckBox->isChecked() && !ui.subInput->text().isEmpty() ) {
227 mrl.append( " :sub-file=" + colon_escape( ui.subInput->text() ) );
228 int align = ui.alignSubComboBox->itemData(
229 ui.alignSubComboBox->currentIndex() ).toInt();
230 mrl.append( " :subsdec-align=" + QString().setNum( align ) );
231 int size = ui.sizeSubComboBox->itemData(
232 ui.sizeSubComboBox->currentIndex() ).toInt();
233 mrl.append( " :freetype-rel-fontsize=" + QString().setNum( size ) );
236 emit mrlUpdated( fileList, mrl );
237 emit methodChanged( "file-caching" );
240 /* Function called by Open Dialog when clicke on Play/Enqueue */
241 void FileOpenPanel::accept()
243 p_intf->p_sys->filepath = dialogBox->directory().absolutePath();
244 ui.fileListWidg->clear();
247 /* Function called by Open Dialog when clicked on cancel */
248 void FileOpenPanel::clear()
250 ui.fileListWidg->clear();
251 ui.subInput->clear();
254 /**************************************************************************
255 * Open Discs ( DVD, CD, VCD and similar devices ) *
256 **************************************************************************/
257 DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
258 OpenPanel( _parent, _p_intf )
262 /* Get the default configuration path for the devices */
263 psz_dvddiscpath = config_GetPsz( p_intf, "dvd" );
264 psz_vcddiscpath = config_GetPsz( p_intf, "vcd" );
265 psz_cddadiscpath = config_GetPsz( p_intf, "cd-audio" );
267 /* State to avoid overwritting the users changes with the configuration */
272 ui.browseDiscButton->setToolTip( qtr( I_DEVICE_TOOLTIP ));
273 ui.deviceCombo->setToolTip( qtr(I_DEVICE_TOOLTIP) );
275 #ifdef WIN32 /* Disc drives probing for Windows */
278 if( GetLogicalDriveStringsA( sizeof( szDrives ) - 1, szDrives ) )
280 char *drive = szDrives;
281 UINT oldMode = SetErrorMode( SEM_FAILCRITICALERRORS );
284 if( GetDriveTypeA(drive) == DRIVE_CDROM )
285 ui.deviceCombo->addItem( drive );
287 /* go to next drive */
290 SetErrorMode(oldMode);
292 #else /* Use a Completer under Linux */
293 QCompleter *discCompleter = new QCompleter( this );
294 discCompleter->setModel( new QDirModel( discCompleter ) );
295 ui.deviceCombo->setCompleter( discCompleter );
299 BUTTONACT( ui.dvdRadioButton, updateButtons() );
300 BUTTONACT( ui.vcdRadioButton, updateButtons() );
301 BUTTONACT( ui.audioCDRadioButton, updateButtons() );
302 BUTTONACT( ui.dvdsimple, updateButtons() );
303 BUTTONACT( ui.browseDiscButton, browseDevice() );
304 BUTTON_SET_ACT_I( ui.ejectButton, "", eject, qtr( "Eject the disc" ),
307 CONNECT( ui.deviceCombo, editTextChanged( QString ), this, updateMRL());
308 CONNECT( ui.titleSpin, valueChanged( int ), this, updateMRL());
309 CONNECT( ui.chapterSpin, valueChanged( int ), this, updateMRL());
310 CONNECT( ui.audioSpin, valueChanged( int ), this, updateMRL());
311 CONNECT( ui.subtitlesSpin, valueChanged( int ), this, updateMRL());
313 /* Run once the updateButtons function in order to fill correctly the comboBoxes */
317 DiscOpenPanel::~DiscOpenPanel()
319 free( psz_dvddiscpath );
320 free( psz_vcddiscpath );
321 free( psz_cddadiscpath );
324 void DiscOpenPanel::clear()
326 ui.titleSpin->setValue( 0 );
327 ui.chapterSpin->setValue( 0 );
328 ui.subtitlesSpin->setValue( -1 );
329 ui.audioSpin->setValue( -1 );
336 #define setDrive( psz_name ) {\
337 int index = ui.deviceCombo->findText( qfu( psz_name ) ); \
338 if( index != -1 ) ui.deviceCombo->setCurrentIndex( index );}
340 #define setDrive( psz_name ) {\
341 ui.deviceCombo->setEditText( qfu( psz_name ) ); }
344 /* update the buttons according the type of device */
345 void DiscOpenPanel::updateButtons()
347 if ( ui.dvdRadioButton->isChecked() )
351 setDrive( psz_dvddiscpath );
354 ui.titleLabel->setText( qtr("Title") );
355 ui.chapterLabel->show();
356 ui.chapterSpin->show();
357 ui.diskOptionBox_2->show();
358 ui.dvdsimple->setEnabled( true );
360 else if ( ui.vcdRadioButton->isChecked() )
364 setDrive( psz_vcddiscpath );
367 ui.titleLabel->setText( qtr("Entry") );
368 ui.chapterLabel->hide();
369 ui.chapterSpin->hide();
370 ui.diskOptionBox_2->show();
371 ui.dvdsimple->setEnabled( false );
377 setDrive( psz_cddadiscpath );
380 ui.titleLabel->setText( qtr("Track") );
381 ui.chapterLabel->hide();
382 ui.chapterSpin->hide();
383 ui.diskOptionBox_2->hide();
384 ui.dvdsimple->setEnabled( false );
390 /* Update the current MRL */
391 void DiscOpenPanel::updateMRL()
394 QStringList fileList;
396 /* CDDAX and VCDX not implemented. TODO ? No. */
398 if( ui.dvdRadioButton->isChecked() ) {
399 if( !ui.dvdsimple->isChecked() )
402 mrl = "dvdsimple://";
403 mrl += ui.deviceCombo->currentText();
404 emit methodChanged( "dvdnav-caching" );
406 if ( ui.titleSpin->value() > 0 ) {
407 mrl += QString("@%1").arg( ui.titleSpin->value() );
408 if ( ui.chapterSpin->value() > 0 ) {
409 mrl+= QString(":%1").arg( ui.chapterSpin->value() );
414 } else if ( ui.vcdRadioButton->isChecked() ) {
415 mrl = "vcd://" + ui.deviceCombo->currentText();
416 emit methodChanged( "vcd-caching" );
418 if( ui.titleSpin->value() > 0 ) {
419 mrl += QString("@E%1").arg( ui.titleSpin->value() );
424 mrl = "cdda://" + ui.deviceCombo->currentText();
427 fileList << mrl; mrl = "";
429 if ( ui.dvdRadioButton->isChecked() || ui.vcdRadioButton->isChecked() )
431 if ( ui.audioSpin->value() >= 0 ) {
432 mrl += " :audio-track=" +
433 QString("%1").arg( ui.audioSpin->value() );
435 if ( ui.subtitlesSpin->value() >= 0 ) {
436 mrl += " :sub-track=" +
437 QString("%1").arg( ui.subtitlesSpin->value() );
442 if( ui.titleSpin->value() > 0 )
443 mrl += QString(" :cdda-track=%1").arg( ui.titleSpin->value() );
445 emit mrlUpdated( fileList, mrl );
448 void DiscOpenPanel::browseDevice()
450 QString dir = QFileDialog::getExistingDirectory( this,
451 qtr( I_DEVICE_TOOLTIP ) );
453 ui.deviceCombo->setEditText( toNativeSepNoSlash( dir ) );
458 void DiscOpenPanel::eject()
460 intf_Eject( p_intf, qtu( ui.deviceCombo->currentText() ) );
463 void DiscOpenPanel::accept()
466 /**************************************************************************
467 * Open Network streams and URL pages *
468 **************************************************************************/
469 NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
470 OpenPanel( _parent, _p_intf )
475 CONNECT( ui.protocolCombo, activated( int ),
476 this, updateProtocol( int ) );
477 CONNECT( ui.portSpin, valueChanged( int ), this, updateMRL() );
478 CONNECT( ui.addressText, textChanged( const QString& ), this, updateMRL());
480 ui.protocolCombo->addItem( "" );
481 ui.protocolCombo->addItem("HTTP", QVariant("http"));
482 ui.protocolCombo->addItem("HTTPS", QVariant("https"));
483 ui.protocolCombo->addItem("MMS", QVariant("mms"));
484 ui.protocolCombo->addItem("FTP", QVariant("ftp"));
485 ui.protocolCombo->addItem("RTSP", QVariant("rtsp"));
486 ui.protocolCombo->addItem("RTP", QVariant("rtp"));
487 ui.protocolCombo->addItem("UDP", QVariant("udp"));
488 ui.protocolCombo->addItem("RTMP", QVariant("rtmp"));
490 updateProtocol( ui.protocolCombo->currentIndex() );
492 if( config_GetInt( p_intf, "qt-recentplay" ) )
494 mrlList = new QStringListModel(
495 getSettings()->value( "Open/netMRL" ).toStringList() );
496 QCompleter *completer = new QCompleter( mrlList, this );
497 ui.addressText->setCompleter( completer );
499 CONNECT( ui.addressText, editingFinished(), this, updateCompleter() );
505 NetOpenPanel::~NetOpenPanel()
507 if( !mrlList ) return;
509 QStringList tempL = mrlList->stringList();
510 while( tempL.size() > 8 ) tempL.removeFirst();
512 getSettings()->setValue( "Open/netMRL", tempL );
517 void NetOpenPanel::clear()
520 /* update the widgets according the type of protocol */
521 void NetOpenPanel::updateProtocol( int idx_proto ) {
522 QString addr = ui.addressText->text();
523 QString proto = ui.protocolCombo->itemData( idx_proto ).toString();
525 ui.portSpin->setEnabled( idx_proto == UDP_PROTO ||
526 idx_proto == RTP_PROTO );
528 if( idx_proto == NO_PROTO ) return;
530 /* If we already have a protocol in the address, replace it */
531 if( addr.contains( "://"))
533 if( idx_proto != UDP_PROTO && idx_proto != RTP_PROTO )
534 addr.replace( QRegExp("^.*://@*"), proto + "://");
535 else if ( ( addr.contains(QRegExp("://((22[4-9])|(23\\d)|(\\[?[fF]{2}[0-9a-fA-F]{2}:))"))) ||
536 ( !addr.contains(QRegExp("^\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}")) &&
537 !addr.contains(QRegExp(":[a-fA-F0-9]{1,4}:")) ) )
538 addr.replace( QRegExp("^.*://"), proto + "://@");
540 addr.replace( QRegExp("^.*://"), proto + "://");
541 addr.replace( QRegExp("@+"), "@");
542 ui.addressText->setText( addr );
547 void NetOpenPanel::updateMRL() {
549 QString addr = ui.addressText->text();
550 addr = QUrl::toPercentEncoding( addr, ":/?#@!$&'()*+,;=" );
551 int idx_proto = ui.protocolCombo->currentIndex();
552 int addr_is_multicast = addr.contains(QRegExp("^(22[4-9])|(23\\d)|(\\[?[fF]{2}[0-9a-fA-F]{2}:)"))?1:0;
553 int addr_is_ipv4 = addr.contains(QRegExp("^\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}"))?1:0;
554 int addr_is_ipv6 = addr.contains(QRegExp(":[a-fA-F0-9]{1,4}:"))?1:0;
555 int addr_has_port = addr.contains(QRegExp("[^:]{5}:\\d{1,5}$"))?1:0;
556 if( addr.contains( "://"))
558 /* Match the correct item in the comboBox */
559 ui.protocolCombo->setCurrentIndex(
560 ui.protocolCombo->findData( addr.section( ':', 0, 0 ) ) );
565 switch( idx_proto ) {
567 mrl = "http://" + addr;
568 emit methodChanged("http-caching");
571 mrl = "https://" + addr;
572 emit methodChanged("http-caching");
575 mrl = "mms://" + addr;
576 emit methodChanged("mms-caching");
579 mrl = "ftp://" + addr;
580 emit methodChanged("ftp-caching");
583 mrl = "rtsp://" + addr;
584 emit methodChanged("rtsp-caching");
587 if(( addr_is_multicast ) || ( !addr_is_ipv4 && !addr_is_ipv6 ))
592 if ( addr_is_ipv6 && !addr.contains('[') )
594 mrl += "[" + addr + "]";
598 mrl += QString(":%1").arg( ui.portSpin->value() );
599 emit methodChanged("udp-caching");
602 if(( addr_is_multicast ) || ( !addr_is_ipv4 && !addr_is_ipv6 ))
606 if ( addr_is_ipv6 && !addr.contains('[') )
607 mrl += "[" + addr + "]"; /* Add [] to IPv6 */
611 mrl += QString(":%1").arg( ui.portSpin->value() );
612 emit methodChanged("rtp-caching");
615 mrl = "rtmp://" + addr;
616 emit methodChanged("rtmp-caching");
621 QStringList qsl; qsl<< mrl;
622 emit mrlUpdated( qsl, "" );
625 void NetOpenPanel::updateCompleter()
628 QStringList tempL = mrlList->stringList();
629 if( !tempL.contains( ui.addressText->text() ) )
630 tempL.append( ui.addressText->text() );
631 mrlList->setStringList( tempL );
634 /**************************************************************************
635 * Open Capture device ( DVB, PVR, V4L, and similar ) *
636 **************************************************************************/
637 CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
638 OpenPanel( _parent, _p_intf )
640 isInitialized = false;
643 void CaptureOpenPanel::initialize()
645 if( isInitialized ) return;
647 msg_Dbg( p_intf, "Initialization of Capture device panel" );
648 isInitialized = true;
652 BUTTONACT( ui.advancedButton, advancedDialog() );
654 /* Create two stacked layouts in the main comboBoxes */
655 QStackedLayout *stackedDevLayout = new QStackedLayout;
656 ui.cardBox->setLayout( stackedDevLayout );
658 QStackedLayout *stackedPropLayout = new QStackedLayout;
659 ui.optionsBox->setLayout( stackedPropLayout );
661 /* Creation and connections of the WIdgets in the stacked layout */
662 #define addModuleAndLayouts( number, name, label ) \
663 QWidget * name ## DevPage = new QWidget( this ); \
664 QWidget * name ## PropPage = new QWidget( this ); \
665 stackedDevLayout->addWidget( name ## DevPage ); \
666 stackedPropLayout->addWidget( name ## PropPage ); \
667 QGridLayout * name ## DevLayout = new QGridLayout; \
668 QGridLayout * name ## PropLayout = new QGridLayout; \
669 name ## DevPage->setLayout( name ## DevLayout ); \
670 name ## PropPage->setLayout( name ## PropLayout ); \
671 ui.deviceCombo->addItem( qtr( label ), QVariant( number ) );
673 #define CuMRL( widget, slot ) CONNECT( widget , slot , this, updateMRL() );
676 /*********************
677 * DirectShow Stuffs *
678 *********************/
679 if( module_exists( "dshow" ) ){
680 addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow" );
684 module_config_t *p_config =
685 config_FindConfig( VLC_OBJECT(p_intf), "dshow-vdev" );
686 vdevDshowW = new StringListConfigControl(
687 VLC_OBJECT(p_intf), p_config, this, false, dshowDevLayout, line );
690 p_config = config_FindConfig( VLC_OBJECT(p_intf), "dshow-adev" );
691 adevDshowW = new StringListConfigControl(
692 VLC_OBJECT(p_intf), p_config, this, false, dshowDevLayout, line );
695 /* dshow Properties */
696 QLabel *dshowVSizeLabel = new QLabel( qtr( "Video size" ) );
697 dshowPropLayout->addWidget( dshowVSizeLabel, 0, 0 );
699 dshowVSizeLine = new QLineEdit;
700 dshowPropLayout->addWidget( dshowVSizeLine, 0, 1);
701 dshowPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
705 CuMRL( vdevDshowW->combo, currentIndexChanged ( int ) );
706 CuMRL( adevDshowW->combo, currentIndexChanged ( int ) );
707 CuMRL( dshowVSizeLine, textChanged( const QString& ) );
713 if( module_exists( "bda" ) ){
714 addModuleAndLayouts( BDA_DEVICE, bda, "DVB DirectShow" );
717 QLabel *bdaTypeLabel = new QLabel( qtr( "DVB Type:" ) );
719 bdas = new QRadioButton( "DVB-S" );
720 bdas->setChecked( true );
721 bdac = new QRadioButton( "DVB-C" );
722 bdat = new QRadioButton( "DVB-T" );
723 bdaa = new QRadioButton( "ATSC" );
725 bdaDevLayout->addWidget( bdaTypeLabel, 0, 0 );
726 bdaDevLayout->addWidget( bdas, 0, 1 );
727 bdaDevLayout->addWidget( bdac, 0, 2 );
728 bdaDevLayout->addWidget( bdat, 0, 3 );
729 bdaDevLayout->addWidget( bdaa, 0, 4 );
732 QLabel *bdaFreqLabel =
733 new QLabel( qtr( "Transponder/multiplex frequency" ) );
734 bdaPropLayout->addWidget( bdaFreqLabel, 0, 0 );
736 bdaFreq = new QSpinBox;
737 bdaFreq->setAlignment( Qt::AlignRight );
738 bdaFreq->setSuffix(" kHz");
739 bdaFreq->setSingleStep( 1000 );
740 setSpinBoxFreq( bdaFreq )
741 bdaPropLayout->addWidget( bdaFreq, 0, 1 );
743 bdaSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
744 bdaPropLayout->addWidget( bdaSrateLabel, 1, 0 );
746 bdaSrate = new QSpinBox;
747 bdaSrate->setAlignment( Qt::AlignRight );
748 bdaSrate->setSuffix(" kHz");
749 setSpinBoxFreq( bdaSrate );
750 bdaPropLayout->addWidget( bdaSrate, 1, 1 );
752 bdaBandLabel = new QLabel( qtr( "Bandwidth" ) );
753 bdaPropLayout->addWidget( bdaBandLabel, 2, 0 );
755 bdaBandBox = new QComboBox;
756 setfillVLCConfigCombo( "dvb-bandwidth", p_intf, bdaBandBox );
757 bdaPropLayout->addWidget( bdaBandBox, 2, 1 );
759 bdaBandLabel->hide();
761 bdaPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
765 CuMRL( bdaFreq, valueChanged ( int ) );
766 CuMRL( bdaSrate, valueChanged ( int ) );
767 CuMRL( bdaBandBox, currentIndexChanged ( int ) );
768 BUTTONACT( bdas, updateButtons() );
769 BUTTONACT( bdat, updateButtons() );
770 BUTTONACT( bdac, updateButtons() );
771 BUTTONACT( bdaa, updateButtons() );
772 BUTTONACT( bdas, updateMRL() );
773 BUTTONACT( bdat, updateMRL() );
774 BUTTONACT( bdac, updateMRL() );
775 BUTTONACT( bdaa, updateMRL() );
782 if( module_exists( "v4l2" ) ){
783 addModuleAndLayouts( V4L2_DEVICE, v4l2, "Video for Linux 2" );
786 QLabel *v4l2VideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
787 v4l2DevLayout->addWidget( v4l2VideoDeviceLabel, 0, 0 );
789 v4l2VideoDevice = new QLineEdit;
790 v4l2DevLayout->addWidget( v4l2VideoDevice, 0, 1 );
792 QLabel *v4l2AudioDeviceLabel = new QLabel( qtr( "Audio device name" ) );
793 v4l2DevLayout->addWidget( v4l2AudioDeviceLabel, 1, 0 );
795 v4l2AudioDevice = new QLineEdit;
796 v4l2DevLayout->addWidget( v4l2AudioDevice, 1, 1 );
798 /* v4l2 Props panel */
799 QLabel *v4l2StdLabel = new QLabel( qtr( "Standard" ) );
800 v4l2PropLayout->addWidget( v4l2StdLabel, 0 , 0 );
802 v4l2StdBox = new QComboBox;
803 setfillVLCConfigCombo( "v4l2-standard", p_intf, v4l2StdBox );
804 v4l2PropLayout->addWidget( v4l2StdBox, 0 , 1 );
805 v4l2PropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
809 CuMRL( v4l2VideoDevice, textChanged( const QString& ) );
810 CuMRL( v4l2AudioDevice, textChanged( const QString& ) );
811 CuMRL( v4l2StdBox, currentIndexChanged ( int ) );
817 if( module_exists( "v4l" ) ){
818 addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux" );
821 QLabel *v4lVideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
822 v4lDevLayout->addWidget( v4lVideoDeviceLabel, 0, 0 );
824 v4lVideoDevice = new QLineEdit;
825 v4lDevLayout->addWidget( v4lVideoDevice, 0, 1 );
827 QLabel *v4lAudioDeviceLabel = new QLabel( qtr( "Audio device name" ) );
828 v4lDevLayout->addWidget( v4lAudioDeviceLabel, 1, 0 );
830 v4lAudioDevice = new QLineEdit;
831 v4lDevLayout->addWidget( v4lAudioDevice, 1, 1 );
833 /* V4l Props panel */
834 QLabel *v4lNormLabel = new QLabel( qtr( "Norm" ) );
835 v4lPropLayout->addWidget( v4lNormLabel, 0 , 0 );
837 v4lNormBox = new QComboBox;
838 setfillVLCConfigCombo( "v4l-norm", p_intf, v4lNormBox );
839 v4lPropLayout->addWidget( v4lNormBox, 0 , 1 );
841 QLabel *v4lFreqLabel = new QLabel( qtr( "Frequency" ) );
842 v4lPropLayout->addWidget( v4lFreqLabel, 1 , 0 );
844 v4lFreq = new QSpinBox;
845 v4lFreq->setAlignment( Qt::AlignRight );
846 v4lFreq->setSuffix(" kHz");
847 setSpinBoxFreq( v4lFreq );
848 v4lPropLayout->addWidget( v4lFreq, 1 , 1 );
849 v4lPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
853 CuMRL( v4lVideoDevice, textChanged( const QString& ) );
854 CuMRL( v4lAudioDevice, textChanged( const QString& ) );
855 CuMRL( v4lFreq, valueChanged ( int ) );
856 CuMRL( v4lNormBox, currentIndexChanged ( int ) );
862 if( module_exists( "jack" ) ){
863 addModuleAndLayouts( JACK_DEVICE, jack, "JACK Audio Connection Kit" );
865 /* Jack Main panel */
867 QLabel *jackChannelsLabel = new QLabel( qtr( "Channels:" ) );
868 jackDevLayout->addWidget( jackChannelsLabel, 1, 0 );
870 jackChannels = new QSpinBox;
871 setSpinBoxFreq( jackChannels );
872 jackChannels->setMaximum(255);
873 jackChannels->setValue(2);
874 jackChannels->setAlignment( Qt::AlignRight );
875 jackDevLayout->addWidget( jackChannels, 1, 1 );
878 QLabel *jackPortsLabel = new QLabel( qtr( "Selected ports:" ) );
879 jackDevLayout->addWidget( jackPortsLabel, 0 , 0 );
881 jackPortsSelected = new QLineEdit( qtr( ".*") );
882 jackPortsSelected->setAlignment( Qt::AlignRight );
883 jackDevLayout->addWidget( jackPortsSelected, 0, 1 );
885 /* Jack Props panel */
888 QLabel *jackCachingLabel = new QLabel( qtr( "Input caching:" ) );
889 jackPropLayout->addWidget( jackCachingLabel, 1 , 0 );
890 jackCaching = new QSpinBox;
891 setSpinBoxFreq( jackCaching );
892 jackCaching->setSuffix( " ms" );
893 jackCaching->setValue(1000);
894 jackCaching->setAlignment( Qt::AlignRight );
895 jackPropLayout->addWidget( jackCaching, 1 , 2 );
898 jackPace = new QCheckBox(qtr( "Use VLC pace" ));
899 jackPropLayout->addWidget( jackPace, 2, 1 );
902 jackConnect = new QCheckBox( qtr( "Auto connnection" ));
903 jackPropLayout->addWidget( jackConnect, 2, 2 );
906 CuMRL( jackChannels, valueChanged( int ) );
907 CuMRL( jackCaching, valueChanged( int ) );
908 CuMRL( jackPace, stateChanged( int ) );
909 CuMRL( jackConnect, stateChanged( int ) );
910 CuMRL( jackPortsSelected, textChanged( const QString& ) );
916 if( module_exists( "pvr" ) ){
917 addModuleAndLayouts( PVR_DEVICE, pvr, "PVR" );
920 QLabel *pvrDeviceLabel = new QLabel( qtr( "Device name" ) );
921 pvrDevLayout->addWidget( pvrDeviceLabel, 0, 0 );
923 pvrDevice = new QLineEdit;
924 pvrDevLayout->addWidget( pvrDevice, 0, 1 );
926 QLabel *pvrRadioDeviceLabel = new QLabel( qtr( "Radio device name" ) );
927 pvrDevLayout->addWidget( pvrRadioDeviceLabel, 1, 0 );
929 pvrRadioDevice = new QLineEdit;
930 pvrDevLayout->addWidget( pvrRadioDevice, 1, 1 );
932 /* PVR props panel */
933 QLabel *pvrNormLabel = new QLabel( qtr( "Norm" ) );
934 pvrPropLayout->addWidget( pvrNormLabel, 0, 0 );
936 pvrNormBox = new QComboBox;
937 setfillVLCConfigCombo( "pvr-norm", p_intf, pvrNormBox );
938 pvrPropLayout->addWidget( pvrNormBox, 0, 1 );
940 QLabel *pvrFreqLabel = new QLabel( qtr( "Frequency" ) );
941 pvrPropLayout->addWidget( pvrFreqLabel, 1, 0 );
943 pvrFreq = new QSpinBox;
944 pvrFreq->setAlignment( Qt::AlignRight );
945 pvrFreq->setSuffix(" kHz");
946 setSpinBoxFreq( pvrFreq );
947 pvrPropLayout->addWidget( pvrFreq, 1, 1 );
949 QLabel *pvrBitrLabel = new QLabel( qtr( "Bitrate" ) );
950 pvrPropLayout->addWidget( pvrBitrLabel, 2, 0 );
952 pvrBitr = new QSpinBox;
953 pvrBitr->setAlignment( Qt::AlignRight );
954 pvrBitr->setSuffix(" kHz");
955 setSpinBoxFreq( pvrBitr );
956 pvrPropLayout->addWidget( pvrBitr, 2, 1 );
957 pvrPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
961 CuMRL( pvrDevice, textChanged( const QString& ) );
962 CuMRL( pvrRadioDevice, textChanged( const QString& ) );
964 CuMRL( pvrFreq, valueChanged ( int ) );
965 CuMRL( pvrBitr, valueChanged ( int ) );
966 CuMRL( pvrNormBox, currentIndexChanged ( int ) );
972 if( module_exists( "dvb" ) ){
973 addModuleAndLayouts( DVB_DEVICE, dvb, "DVB" );
976 QLabel *dvbDeviceLabel = new QLabel( qtr( "Adapter card to tune" ) );
977 QLabel *dvbTypeLabel = new QLabel( qtr( "DVB Type:" ) );
979 dvbCard = new QSpinBox;
980 dvbCard->setAlignment( Qt::AlignRight );
981 dvbCard->setPrefix( "/dev/dvb/adapter" );
983 dvbDevLayout->addWidget( dvbDeviceLabel, 0, 0 );
984 dvbDevLayout->addWidget( dvbCard, 0, 2, 1, 2 );
986 dvbs = new QRadioButton( "DVB-S" );
987 dvbs->setChecked( true );
988 dvbc = new QRadioButton( "DVB-C" );
989 dvbt = new QRadioButton( "DVB-T" );
991 dvbDevLayout->addWidget( dvbTypeLabel, 1, 0 );
992 dvbDevLayout->addWidget( dvbs, 1, 1 );
993 dvbDevLayout->addWidget( dvbc, 1, 2 );
994 dvbDevLayout->addWidget( dvbt, 1, 3 );
996 /* DVB Props panel */
997 QLabel *dvbFreqLabel =
998 new QLabel( qtr( "Transponder/multiplex frequency" ) );
999 dvbPropLayout->addWidget( dvbFreqLabel, 0, 0 );
1001 dvbFreq = new QSpinBox;
1002 dvbFreq->setAlignment( Qt::AlignRight );
1003 dvbFreq->setSuffix(" kHz");
1004 dvbFreq->setSingleStep( 1000 );
1005 setSpinBoxFreq( dvbFreq );
1006 dvbPropLayout->addWidget( dvbFreq, 0, 1 );
1008 dvbSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
1009 dvbPropLayout->addWidget( dvbSrateLabel, 1, 0 );
1011 dvbSrate = new QSpinBox;
1012 dvbSrate->setAlignment( Qt::AlignRight );
1013 dvbSrate->setSuffix(" kHz");
1014 setSpinBoxFreq( dvbSrate );
1015 dvbPropLayout->addWidget( dvbSrate, 1, 1 );
1017 dvbBandLabel = new QLabel( qtr( "Bandwidth" ) );
1018 dvbPropLayout->addWidget( dvbBandLabel, 2, 0 );
1020 dvbBandBox = new QComboBox;
1021 /* This doesn't work since dvb-bandwidth doesn't seem to be a
1023 setfillVLCConfigCombo( "dvb-bandwidth", p_intf, bdaBandBox );
1025 dvbBandBox->addItem( qtr( "Auto" ), 0 );
1026 dvbBandBox->addItem( qtr( "6 MHz" ), 6 );
1027 dvbBandBox->addItem( qtr( "7 MHz" ), 7 );
1028 dvbBandBox->addItem( qtr( "8 MHz" ), 8 );
1029 dvbPropLayout->addWidget( dvbBandBox, 2, 1 );
1031 dvbBandLabel->hide();
1034 dvbPropLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ),
1038 CuMRL( dvbCard, valueChanged ( int ) );
1039 CuMRL( dvbFreq, valueChanged ( int ) );
1040 CuMRL( dvbSrate, valueChanged ( int ) );
1042 BUTTONACT( dvbs, updateButtons() );
1043 BUTTONACT( dvbt, updateButtons() );
1044 BUTTONACT( dvbc, updateButtons() );
1053 addModuleAndLayouts( SCREEN_DEVICE, screen, "Desktop" );
1054 QLabel *screenLabel = new QLabel( qtr( "Your display will be "
1055 "opened and played in order to stream or save it." ) );
1056 screenLabel->setWordWrap( true );
1057 screenDevLayout->addWidget( screenLabel, 0, 0 );
1059 QLabel *screenFPSLabel = new QLabel(
1060 qtr( "Desired frame rate for the capture." ) );
1061 screenPropLayout->addWidget( screenFPSLabel, 0, 0 );
1063 screenFPS = new QSpinBox;
1064 screenFPS->setValue( 1 );
1065 screenFPS->setAlignment( Qt::AlignRight );
1066 screenPropLayout->addWidget( screenFPS, 0, 1 );
1068 /* General connects */
1069 CONNECT( ui.deviceCombo, activated( int ) ,
1070 stackedDevLayout, setCurrentIndex( int ) );
1071 CONNECT( ui.deviceCombo, activated( int ),
1072 stackedPropLayout, setCurrentIndex( int ) );
1073 CONNECT( ui.deviceCombo, activated( int ), this, updateMRL() );
1074 CONNECT( ui.deviceCombo, activated( int ), this, updateButtons() );
1079 CaptureOpenPanel::~CaptureOpenPanel()
1083 void CaptureOpenPanel::clear()
1088 void CaptureOpenPanel::updateMRL()
1091 QStringList fileList;
1092 int i_devicetype = ui.deviceCombo->itemData(
1093 ui.deviceCombo->currentIndex() ).toInt();
1094 switch( i_devicetype )
1098 if( bdas->isChecked() ) mrl = "dvb-s://";
1099 else if( bdat->isChecked() ) mrl = "dvb-t://";
1100 else if( bdac->isChecked() ) mrl = "dvb-c://";
1101 else if( bdaa->isChecked() ) mrl = "atsc://";
1103 fileList << mrl; mrl = "";
1105 mrl += " :dvb-frequency=" + QString::number( bdaFreq->value() );
1106 if( bdas->isChecked() || bdac->isChecked() )
1107 mrl += " :dvb-srate=" + QString::number( bdaSrate->value() );
1108 else if( bdat->isChecked() || bdaa->isChecked() )
1109 mrl += " :dvb-bandwidth=" +
1110 QString::number( bdaBandBox->itemData(
1111 bdaBandBox->currentIndex() ).toInt() );
1114 fileList << "dshow://";
1115 mrl+= " :dshow-vdev=" +
1116 colon_escape( QString("%1").arg( vdevDshowW->getValue() ) );
1117 mrl+= " :dshow-adev=" +
1118 colon_escape( QString("%1").arg( adevDshowW->getValue() ) );
1119 if( dshowVSizeLine->isModified() )
1120 mrl += " :dshow-size=" + dshowVSizeLine->text();
1124 fileList << "v4l://";
1125 mrl += " :v4l-vdev=" + v4lVideoDevice->text();
1126 mrl += " :v4l-adev=" + v4lAudioDevice->text();
1127 mrl += " :v4l-norm=" + QString::number( v4lNormBox->currentIndex() );
1128 mrl += " :v4l-frequency=" + QString::number( v4lFreq->value() );
1131 fileList << "v4l2://";
1132 mrl += " :v4l2-dev=" + v4l2VideoDevice->text();
1133 mrl += " :v4l2-adev=" + v4l2AudioDevice->text();
1134 mrl += " :v4l2-standard=" + QString::number( v4l2StdBox->currentIndex() );
1138 mrl += "channels=" + QString::number( jackChannels->value() );
1139 mrl += ":ports=" + jackPortsSelected->text();
1140 fileList << mrl; mrl = "";
1142 mrl += " :jack-input-caching=" + QString::number( jackCaching->value() );
1143 if ( jackPace->isChecked() )
1145 mrl += " :jack-input-use-vlc-pace";
1147 if ( jackConnect->isChecked() )
1149 mrl += " :jack-input-auto-connect";
1153 fileList << "pvr://";
1154 mrl += " :pvr-device=" + pvrDevice->text();
1155 mrl += " :pvr-radio-device=" + pvrRadioDevice->text();
1156 mrl += " :pvr-norm=" + QString::number( pvrNormBox->currentIndex() );
1157 if( pvrFreq->value() )
1158 mrl += " :pvr-frequency=" + QString::number( pvrFreq->value() );
1159 if( pvrBitr->value() )
1160 mrl += " :pvr-bitrate=" + QString::number( pvrBitr->value() );
1163 fileList << "dvb://";
1164 mrl += " :dvb-adapter=" + QString::number( dvbCard->value() );
1165 mrl += " :dvb-frequency=" + QString::number( dvbFreq->value() );
1166 if( dvbs->isChecked() || dvbc->isChecked() )
1167 mrl += " :dvb-srate=" + QString::number( dvbSrate->value() );
1168 else if( dvbt->isChecked() )
1169 mrl += " :dvb-bandwidth=" +
1170 QString::number( dvbBandBox->itemData(
1171 dvbBandBox->currentIndex() ).toInt() );
1176 fileList << "screen://";
1177 mrl = " :screen-fps=" + QString::number( screenFPS->value() );
1182 if( !advMRL.isEmpty() ) mrl += advMRL;
1184 emit mrlUpdated( fileList, mrl );
1188 * Update the Buttons (show/hide) for the GUI as all device type don't
1189 * use the same ui. elements.
1191 void CaptureOpenPanel::updateButtons()
1193 /* Be sure to display the ui Elements in case they were hidden by
1194 * some Device Type (like Screen://) */
1195 ui.optionsBox->show();
1196 ui.advancedButton->show();
1197 /* Get the current Device Number */
1198 int i_devicetype = ui.deviceCombo->itemData(
1199 ui.deviceCombo->currentIndex() ).toInt();
1200 switch( i_devicetype )
1204 if( bdas->isChecked() || bdac->isChecked() )
1207 bdaSrateLabel->show();
1209 bdaBandLabel->hide();
1211 else if( bdat->isChecked() || bdaa->isChecked() )
1214 bdaSrateLabel->hide();
1216 bdaBandLabel->show();
1218 if( bdas->isChecked() )
1220 bdaFreq->setSuffix(" kHz");
1221 bdaFreq->setSingleStep( 1000 );
1223 if( bdac->isChecked() || bdat->isChecked() || bdaa->isChecked( ) )
1225 bdaFreq->setSuffix(" Hz");
1226 bdaFreq->setSingleStep( 100000 );
1231 if( dvbs->isChecked() || dvbc->isChecked() )
1234 dvbSrateLabel->show();
1236 dvbBandLabel->hide();
1238 else if( dvbt->isChecked() )
1241 dvbSrateLabel->hide();
1243 dvbBandLabel->show();
1245 if( dvbs->isChecked() ) dvbFreq->setSuffix(" kHz");
1246 if( dvbc->isChecked() || dvbt->isChecked() ) dvbFreq->setSuffix(" Hz");
1250 //ui.optionsBox->hide();
1251 ui.advancedButton->hide();
1258 void CaptureOpenPanel::advancedDialog()
1260 /* Get selected device type */
1261 int i_devicetype = ui.deviceCombo->itemData(
1262 ui.deviceCombo->currentIndex() ).toInt();
1264 /* Get the corresponding module */
1265 module_t *p_module =
1266 module_find( psz_devModule[i_devicetype] );
1267 if( NULL == p_module ) return;
1270 QList<ConfigControl *> controls;
1272 /* Get the confsize */
1273 unsigned int i_confsize;
1274 module_config_t *p_config;
1275 p_config = module_config_get( p_module, &i_confsize );
1277 /* New Adv Prop dialog */
1278 adv = new QDialog( this );
1279 adv->setWindowTitle( qtr( "Advanced Options" ) );
1281 /* A main Layout with a Frame */
1282 QVBoxLayout *mainLayout = new QVBoxLayout( adv );
1283 QScrollArea *scroll = new QScrollArea;
1284 mainLayout->addWidget( scroll );
1286 QFrame *advFrame = new QFrame;
1287 /* GridLayout inside the Frame */
1288 QGridLayout *gLayout = new QGridLayout( advFrame );
1290 scroll->setWidgetResizable( true );
1291 scroll->setWidget( advFrame );
1293 /* Create the options inside the FrameLayout */
1294 for( int n = 0; n < (int)i_confsize; n++ )
1296 module_config_t *p_item = p_config + n;
1297 ConfigControl *config = ConfigControl::createControl(
1298 VLC_OBJECT( p_intf ), p_item, advFrame, gLayout, n );
1300 controls.append( config );
1304 QDialogButtonBox *advButtonBox = new QDialogButtonBox( adv );
1305 QPushButton *closeButton = new QPushButton( qtr( "OK" ) );
1306 QPushButton *cancelButton = new QPushButton( qtr( "Cancel" ) );
1308 CONNECT( closeButton, clicked(), adv, accept() );
1309 CONNECT( cancelButton, clicked(), adv, reject() );
1311 advButtonBox->addButton( closeButton, QDialogButtonBox::AcceptRole );
1312 advButtonBox->addButton( cancelButton, QDialogButtonBox::RejectRole );
1314 mainLayout->addWidget( advButtonBox );
1316 /* Creation of the MRL */
1319 QString tempMRL = "";
1320 for( int i = 0; i < controls.size(); i++ )
1322 ConfigControl *control = controls[i];
1324 tempMRL += (i ? " :" : ":");
1326 if( control->getType() == CONFIG_ITEM_BOOL )
1327 if( !(qobject_cast<VIntConfigControl *>(control)->getValue() ) )
1330 tempMRL += control->getName();
1332 switch( control->getType() )
1334 case CONFIG_ITEM_STRING:
1335 case CONFIG_ITEM_FILE:
1336 case CONFIG_ITEM_DIRECTORY:
1337 case CONFIG_ITEM_MODULE:
1338 tempMRL += colon_escape( QString("=%1").arg( qobject_cast<VStringConfigControl *>(control)->getValue() ) );
1340 case CONFIG_ITEM_INTEGER:
1341 tempMRL += QString("=%1").arg( qobject_cast<VIntConfigControl *>(control)->getValue() );
1343 case CONFIG_ITEM_FLOAT:
1344 tempMRL += QString("=%1").arg( qobject_cast<VFloatConfigControl *>(control)->getValue() );
1350 msg_Dbg( p_intf, "%s", qtu( advMRL ) );
1352 for( int i = 0; i < controls.size(); i++ )
1354 ConfigControl *control = controls[i];
1358 module_config_free( p_config );
1359 module_release (p_module);