]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/convert.cpp
Qt: provide a way to dump from the convert dialog.
[vlc] / modules / gui / qt4 / dialogs / convert.cpp
index b9680ab98b531369606aa3da0096d54565353101..bad51814bb141a5021e01af423061e9688daa4e7 100644 (file)
 #include <QFileDialog>
 #include <QCheckBox>
 
-ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf)
+ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
+                              QString inputMRL )
               : QVLCDialog( parent, _p_intf )
 {
     setWindowTitle( qtr( "Convert" ) );
 
     QGridLayout *mainLayout = new QGridLayout( this );
-    mainLayout->addWidget( new SoutInputBox( this ), 0, 0, 1, -1  );
+    SoutInputBox *inputBox = new SoutInputBox( this );
+    inputBox->setMRL( inputMRL );
+    mainLayout->addWidget( inputBox, 0, 0, 1, -1  );
 
     /**
      * Destination
@@ -51,7 +54,7 @@ ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf)
     QGroupBox *destBox = new QGroupBox( qtr( "Destination" ) );
     QGridLayout *destLayout = new QGridLayout( destBox );
 
-    QLabel *destLabel = new QLabel( qtr( "Target file:" ) );
+    QLabel *destLabel = new QLabel( qtr( "Destination file:" ) );
     destLayout->addWidget( destLabel, 0, 0);
 
     fileLine = new QLineEdit;
@@ -77,11 +80,14 @@ ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf)
     QGridLayout *settingLayout = new QGridLayout( settingBox );
 
     profile = new VLCProfileSelector( this );
-    settingLayout->addWidget( profile, 0, 0 );
+    settingLayout->addWidget( profile, 0, 0, 1, -1 );
 
     deinterBox = new QCheckBox( qtr( "Deinterlace" ) );
     settingLayout->addWidget( deinterBox, 1, 0 );
 
+    dumpBox = new QCheckBox( qtr( "Dump raw input" ) );
+    settingLayout->addWidget( dumpBox, 1, 1 );
+
     mainLayout->addWidget( settingBox, 3, 0, 1, -1  );
 
     /* Buttons */
@@ -109,23 +115,31 @@ void ConvertDialog::fileBrowse()
 
 void ConvertDialog::cancel()
 {
-    hide();
+    reject();
 }
 
 void ConvertDialog::close()
 {
     hide();
 
-    mrl = "sout=#" + profile->getTranscode();
-    if( deinterBox->isChecked() )
+    if( dumpBox->isChecked() )
     {
-        mrl.remove( '}' );
-        mrl += ",deinterlace}";
+        mrl = "demux=dump :demuxdump-file" + fileLine->text();
     }
-    mrl += ":duplicate{";
-    if( displayBox->isChecked() ) mrl += "dst=display,";
-    mrl += "dst=std{access=file,mux=" + profile->getMux() +
+    else
+    {
+        mrl = "sout=#" + profile->getTranscode();
+        if( deinterBox->isChecked() )
+        {
+            mrl.remove( '}' );
+            mrl += ",deinterlace}";
+        }
+        mrl += ":duplicate{";
+        if( displayBox->isChecked() ) mrl += "dst=display,";
+        mrl += "dst=std{access=file,mux=" + profile->getMux() +
             ",dst='" + fileLine->text() + "'}";
+    }
 
     msg_Dbg( p_intf, "Transcode MRL: %s", qtu( mrl ) );
+    accept();
 }