Commit 11a4d091 authored by Till Theato's avatar Till Theato
Browse files

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
parent bca25097
This diff is collapsed.
......@@ -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 <QString, QString> 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") {
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>389</width>
<height>631</height>
<width>391</width>
<height>652</height>
</rect>
</property>
<property name="windowTitle">
......@@ -198,7 +198,7 @@
</property>
</widget>
</item>
<item row="6" column="0" colspan="10">
<item row="7" column="0" colspan="10">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="rescale">
......@@ -271,35 +271,35 @@
</item>
</layout>
</item>
<item row="7" column="0" colspan="10">
<item row="8" column="0" colspan="10">
<widget class="QCheckBox" name="open_dvd">
<property name="text">
<string>Open Dvd wizard after rendering</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="10">
<item row="9" column="0" colspan="10">
<widget class="QCheckBox" name="create_chapter">
<property name="text">
<string>Create chapter file based on guides</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="10">
<item row="10" column="0" colspan="10">
<widget class="QCheckBox" name="open_browser">
<property name="text">
<string>Open browser window after export</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="4">
<item row="11" column="0" colspan="4">
<widget class="QCheckBox" name="play_after">
<property name="text">
<string>Play after render</string>
</property>
</widget>
</item>
<item row="12" column="0" colspan="10">
<item row="13" column="0" colspan="10">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="render_full">
......@@ -340,7 +340,7 @@
</item>
</layout>
</item>
<item row="13" column="0" colspan="10">
<item row="14" column="0" colspan="10">
<widget class="QGroupBox" name="guides_box">
<property name="title">
<string/>
......@@ -383,21 +383,21 @@
</layout>
</widget>
</item>
<item row="16" column="0" colspan="3">
<item row="17" column="0" colspan="3">
<widget class="QPushButton" name="buttonRender">
<property name="text">
<string>Render to File</string>
</property>
</widget>
</item>
<item row="16" column="3" colspan="4">
<item row="17" column="3" colspan="4">
<widget class="QPushButton" name="buttonGenerateScript">
<property name="text">
<string>Generate Script</string>
</property>
</widget>
</item>
<item row="16" column="7" colspan="2">
<item row="17" column="7" colspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
......@@ -410,14 +410,14 @@
</property>
</spacer>
</item>
<item row="16" column="9">
<item row="17" column="9">
<widget class="KPushButton" name="buttonClose">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
<item row="17" column="0" colspan="10">
<item row="18" column="0" colspan="10">
<widget class="QGroupBox" name="errorBox">
<property name="title">
<string/>
......@@ -446,21 +446,21 @@
</layout>
</widget>
</item>
<item row="15" column="0" colspan="10">
<item row="16" column="0" colspan="10">
<widget class="QCheckBox" name="proxy_render">
<property name="text">
<string>Render using proxy clips</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="3">
<item row="6" column="0" colspan="3">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Encoder threads</string>
</property>
</widget>
</item>
<item row="5" column="4" colspan="2">
<item row="6" column="4" colspan="2">
<widget class="KIntNumInput" name="encoder_threads">
<property name="minimum">
<number>1</number>
......@@ -470,7 +470,7 @@
</property>
</widget>
</item>
<item row="11" column="0" colspan="3">
<item row="12" column="0" colspan="3">
<widget class="QCheckBox" name="tc_overlay">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
......@@ -483,7 +483,7 @@
</property>
</widget>
</item>
<item row="11" column="3" colspan="5">
<item row="12" column="3" colspan="5">
<widget class="KComboBox" name="tc_type">
<item>
<property name="text">
......@@ -497,6 +497,13 @@
</item>
</widget>
</item>
<item row="5" column="0" colspan="4">
<widget class="QCheckBox" name="checkTwoPass">
<property name="text">
<string>2 pass</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment