MeltJob::MeltJob(const QString& name, const QString& xml, int frameRateNum, int frameRateDen) : AbstractJob(name) , m_isStreaming(false) , m_previousPercent(0) , m_currentFrame(0) , m_useMultiConsumer(false) { if (!xml.isEmpty()) { QAction* action = new QAction(tr("View XML"), this); action->setToolTip(tr("View the MLT XML for this job")); connect(action, SIGNAL(triggered()), this, SLOT(onViewXmlTriggered())); m_standardActions << action; m_xml.setFileTemplate(QDir::tempPath().append("/shotcut-XXXXXX.mlt")); m_xml.open(); m_xml.write(xml.toUtf8()); m_xml.close(); } else { // Not an EncodeJob QAction* action = new QAction(tr("Open"), this); action->setToolTip(tr("Open the output file in the Shotcut player")); connect(action, SIGNAL(triggered()), this, SLOT(onOpenTiggered())); m_successActions << action; action = new QAction(tr("Show In Folder"), this); action->setToolTip(tr("Show In Folder")); connect(action, SIGNAL(triggered()), this, SLOT(onShowFolderTriggered())); m_successActions << action; } if (frameRateNum > 0 && frameRateDen > 0) m_profile.set_frame_rate(frameRateNum, frameRateDen); }
VideoQualityJob::VideoQualityJob(const QString& name, const QString& xml, const QString& reportPath) : MeltJob(name, xml) , m_reportPath(reportPath) { QAction* action = new QAction(tr("Open"), this); action->setToolTip(tr("Open original and encoded side-by-side in the Shotcut player")); connect(action, SIGNAL(triggered()), this, SLOT(onOpenTiggered())); m_successActions << action; action = new QAction(tr("View Report"), this); connect(action, SIGNAL(triggered()), this, SLOT(onViewReportTriggered())); m_successActions << action; action = new QAction(tr("Show In Folder"), this); connect(action, SIGNAL(triggered()), this, SLOT(onShowFolderTriggered())); m_successActions << action; setLabel(tr("Measure %1").arg(objectName())); setStandardOutputFile(reportPath); }