#include "dialogs/sout.hpp"
#include "dialogs/convert.hpp"
+#include "components/sout/sout_widgets.hpp"
#include "util/qt_dirs.hpp"
#include <QFileDialog>
#include <QCheckBox>
-ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf)
+ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
+ const QString& inputMRL )
: QVLCDialog( parent, _p_intf )
{
setWindowTitle( qtr( "Convert" ) );
QGridLayout *mainLayout = new QGridLayout( this );
-
- /**
- * Source Block
- **/
- QGroupBox *sourceBox = new QGroupBox( qtr( "Source" ) );
- QGridLayout *sourceLayout = new QGridLayout( sourceBox );
-
- QLabel *sourceLabel = new QLabel( qtr( "Source:" ) );
- sourceLayout->addWidget( sourceLabel, 0, 0 );
-
- QLineEdit *sourceLine = new QLineEdit;
- sourceLine->setReadOnly( true );
- sourceLabel->setBuddy( sourceLine );
- sourceLayout->addWidget( sourceLine, 0, 1 );
-
- QLabel *sourceTypeLabel = new QLabel( qtr( "Type:" ) );
- sourceLayout->addWidget( sourceTypeLabel, 1, 0 );
- QLabel *sourceValueLabel = new QLabel;
- sourceLayout->addWidget( sourceValueLabel, 1, 1 );
-
- /* Line */
- QFrame *line = new QFrame;
- line->setFrameStyle( QFrame::HLine |QFrame::Sunken );
- sourceLayout->addWidget( line, 2, 0, 1, -1 );
-
- mainLayout->addWidget( sourceBox, 0, 0, 1, -1 );
+ SoutInputBox *inputBox = new SoutInputBox( this );
+ inputBox->setMRL( inputMRL );
+ mainLayout->addWidget( inputBox, 0, 0, 1, -1 );
/**
* Destination
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;
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 */
void ConvertDialog::cancel()
{
- hide();
+ reject();
}
void ConvertDialog::close()
{
hide();
- QString 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();
}