From: Till Theato Date: Thu, 19 May 2011 19:00:21 +0000 (+0000) Subject: Render dialog: control 2 pass option with a checkbox. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=11a4d09164d3e0d7dcbe5891cb5ccc8c50c89e17;p=kdenlive Render dialog: control 2 pass option with a checkbox. Option can be made unavailable per group in profiles.xml by setting the attribute twopass="false". svn path=/trunk/kdenlive/; revision=5599 --- diff --git a/export/profiles.xml b/export/profiles.xml index 013d93f0..9e347c48 100644 --- a/export/profiles.xml +++ b/export/profiles.xml @@ -1,20 +1,14 @@ - - - - - - - + @@ -31,7 +25,7 @@ - + @@ -50,216 +44,122 @@ DVD - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -276,40 +176,26 @@ Media players - - - - - - Web sites - - - - - + - - - - - + Audio only @@ -317,29 +203,26 @@ - + Lossless / HQ - - - + + + Mobile devices - - + - Mobile devices - diff --git a/src/renderwidget.cpp b/src/renderwidget.cpp index dd5e2024..683035b1 100644 --- a/src/renderwidget.cpp +++ b/src/renderwidget.cpp @@ -53,6 +53,7 @@ const int ParamsRole = GroupRole + 4; const int EditableRole = GroupRole + 5; const int MetaGroupRole = GroupRole + 6; const int ExtraRole = GroupRole + 7; +const int TwoPassRole = GroupRole + 8; // Running job status const int WAITINGJOB = 0; @@ -176,6 +177,7 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, QWidg m_view.open_browser->setVisible(false); m_view.error_box->setVisible(false); m_view.tc_type->setEnabled(false); + m_view.checkTwoPass->setEnabled(false); m_view.splitter->setStretchFactor(1, 5); m_view.splitter->setStretchFactor(0, 2); @@ -766,9 +768,13 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const // disable audio if requested if (!exportAudio) renderArgs.append(" an=1 "); - // Set the thread counts - renderArgs.append(QString(" threads=%1").arg(KdenliveSettings::encodethreads())); - renderArgs.append(QString(" real_time=-%1").arg(KdenliveSettings::mltthreads())); + // Set the thread counts + renderArgs.append(QString(" threads=%1").arg(KdenliveSettings::encodethreads())); + renderArgs.append(QString(" real_time=-%1").arg(KdenliveSettings::mltthreads())); + + // 2 pass + if (m_view.checkTwoPass->isEnabled() && m_view.checkTwoPass->isChecked()) + renderArgs.append(" pass=2"); // Check if the rendering profile is different from project profile, // in which case we need to use the producer_comsumer from MLT @@ -857,6 +863,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const renderProps.insert("rendertctype", QString::number(m_view.tc_type->currentIndex())); renderProps.insert("renderratio", QString::number(m_view.rescale_keep->isChecked())); renderProps.insert("renderplay", QString::number(m_view.play_after->isChecked())); + renderProps.insert("rendertwopass", QString::number(m_view.checkTwoPass->isChecked())); emit selectedRenderProfile(renderProps); @@ -966,8 +973,10 @@ void RenderWidget::setProfile(MltVideoProfile profile) { m_profile = profile; //WARNING: this way to tell the video standard is a bit hackish... - if (m_profile.description.contains("pal", Qt::CaseInsensitive) || m_profile.description.contains("25", Qt::CaseInsensitive) || m_profile.description.contains("50", Qt::CaseInsensitive)) m_view.format_selection->setCurrentIndex(0); - else m_view.format_selection->setCurrentIndex(1); + if (m_profile.description.contains("pal", Qt::CaseInsensitive) || m_profile.description.contains("25", Qt::CaseInsensitive) || m_profile.description.contains("50", Qt::CaseInsensitive)) + m_view.format_selection->setCurrentIndex(0); + else + m_view.format_selection->setCurrentIndex(1); m_view.scanning_list->setCurrentIndex(0); m_view.rescale_width->setValue(KdenliveSettings::defaultrescalewidth()); if (!m_view.rescale_keep->isChecked()) { @@ -1048,6 +1057,8 @@ void RenderWidget::refreshView() destination = m_view.destination_list->itemData(m_view.destination_list->currentIndex()).toString(); KIcon brokenIcon("dialog-close"); + m_view.checkTwoPass->setEnabled(m_view.format_list->currentItem()->data(TwoPassRole).toBool()); + const QStringList formatsList = KdenliveSettings::supportedformats(); const QStringList vcodecsList = KdenliveSettings::videocodecs(); const QStringList acodecsList = KdenliveSettings::audiocodecs(); @@ -1401,6 +1412,7 @@ void RenderWidget::parseFile(QString exportFile, bool editable) QString renderer; QString params; QString standard; + QString twoPass; KIcon icon; while (!groups.item(i).isNull()) { @@ -1425,6 +1437,7 @@ void RenderWidget::parseFile(QString exportFile, bool editable) groupName = documentElement.attribute("name", i18nc("Attribute Name", "Custom")); extension = documentElement.attribute("extension", QString()); renderer = documentElement.attribute("renderer", QString()); + twoPass = documentElement.attribute("twopass", "true"); bool exists = false; for (int j = 0; j < m_renderCategory.count(); j++) { if (m_renderCategory.at(j)->text() == groupName && m_renderCategory.at(j)->data(MetaGroupRole) == metagroupId) { @@ -1435,6 +1448,7 @@ void RenderWidget::parseFile(QString exportFile, bool editable) if (!exists) { QListWidgetItem *itemcat = new QListWidgetItem(groupName); //, m_view.format_list); itemcat->setData(MetaGroupRole, metagroupId); + itemcat->setData(TwoPassRole, twoPass == "false" ? false : true); m_renderCategory.append(itemcat); } @@ -1756,6 +1770,7 @@ void RenderWidget::setRenderProfile(QMap props) if (props.contains("rendertctype")) m_view.tc_type->setCurrentIndex(props.value("rendertctype").toInt()); if (props.contains("renderratio")) m_view.rescale_keep->setChecked(props.value("renderratio").toInt()); if (props.contains("renderplay")) m_view.play_after->setChecked(props.value("renderplay").toInt()); + if (props.contains("rendertwopass")) m_view.checkTwoPass->setChecked(props.value("rendertwopass").toInt()); if (props.value("renderzone") == "1") m_view.render_zone->setChecked(true); else if (props.value("renderguide") == "1") { diff --git a/src/widgets/renderwidget_ui.ui b/src/widgets/renderwidget_ui.ui index 3ef4f9fa..39f766ec 100644 --- a/src/widgets/renderwidget_ui.ui +++ b/src/widgets/renderwidget_ui.ui @@ -6,8 +6,8 @@ 0 0 - 389 - 631 + 391 + 652 @@ -198,7 +198,7 @@ - + @@ -271,35 +271,35 @@ - + Open Dvd wizard after rendering - + Create chapter file based on guides - + Open browser window after export - + Play after render - + @@ -340,7 +340,7 @@ - + @@ -383,21 +383,21 @@ - + Render to File - + Generate Script - + Qt::Horizontal @@ -410,14 +410,14 @@ - + Close - + @@ -446,21 +446,21 @@ - + Render using proxy clips - + Encoder threads - + 1 @@ -470,7 +470,7 @@ - + @@ -483,7 +483,7 @@ - + @@ -497,6 +497,13 @@ + + + + 2 pass + + +