if (props.contains("video_max")) {
m_view.clip_vindex->setMaximum(props.value("video_max").toInt());
}
+
+ m_view.clip_colorspace->addItem(ProfilesDialog::getColorspaceDescription(601), 601);
+ m_view.clip_colorspace->addItem(ProfilesDialog::getColorspaceDescription(709), 709);
+ m_view.clip_colorspace->addItem(ProfilesDialog::getColorspaceDescription(240), 240);
+ if (props.contains("force_colorspace")) {
+ m_view.clip_force_colorspace->setChecked(true);
+ m_view.clip_colorspace->setEnabled(true);
+ m_view.clip_colorspace->setCurrentIndex(m_view.clip_colorspace->findData(props.value("force_colorspace").toInt()));
+ } else if (props.contains("colorspace")) {
+ m_view.clip_colorspace->setCurrentIndex(m_view.clip_colorspace->findData(props.value("colorspace").toInt()));
+ }
+ connect(m_view.clip_force_colorspace, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.clip_colorspace, SIGNAL(currentIndexChanged(int)), this, SLOT(slotModified()));
+
+ if (props.contains("full_luma")) {
+ m_view.clip_full_luma->setChecked(true);
+ }
+ connect(m_view.clip_full_luma, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
// Check for Metadata
QMap<QString, QString> meta = m_clip->metadata();
connect(m_view.clip_force_threads, SIGNAL(toggled(bool)), m_view.clip_threads, SLOT(setEnabled(bool)));
connect(m_view.clip_force_vindex, SIGNAL(toggled(bool)), m_view.clip_vindex, SLOT(setEnabled(bool)));
connect(m_view.clip_force_aindex, SIGNAL(toggled(bool)), m_view.clip_aindex, SLOT(setEnabled(bool)));
+ connect(m_view.clip_force_colorspace, SIGNAL(toggled(bool)), m_view.clip_colorspace, SLOT(setEnabled(bool)));
if (props.contains("audiocodec"))
QTreeWidgetItem *item = new QTreeWidgetItem(m_view.clip_aproperties, QStringList() << i18n("Audio codec") << props.value("audiocodec"));
if (props.contains("video_max")) {
m_view.clip_vindex->setMaximum(props.value("video_max").toInt());
}
+
+ if (commonproperties.contains("force_colorspace") && !commonproperties.value("force_colorspace").isEmpty() && commonproperties.value("force_colorspace").toInt() != 0) {
+ m_view.clip_force_colorspace->setChecked(true);
+ m_view.clip_colorspace->setEnabled(true);
+ m_view.clip_colorspace->setCurrentIndex(m_view.clip_colorspace->findData(commonproperties.value("force_colorspace").toInt()));
+ }
+
+ if (commonproperties.contains("full_luma") && !commonproperties.value("full_luma").isEmpty()) {
+ m_view.clip_full_luma->setChecked(true);
+ }
connect(m_view.clip_force_ar, SIGNAL(toggled(bool)), m_view.clip_ar, SLOT(setEnabled(bool)));
connect(m_view.clip_force_progressive, SIGNAL(toggled(bool)), m_view.clip_progressive, SLOT(setEnabled(bool)));
connect(m_view.clip_force_vindex, SIGNAL(toggled(bool)), m_view.clip_vindex, SLOT(setEnabled(bool)));
connect(m_view.clip_force_aindex, SIGNAL(toggled(bool)), m_view.clip_aindex, SLOT(setEnabled(bool)));
connect(m_view.clip_force_out, SIGNAL(toggled(bool)), m_view.clip_out, SLOT(setEnabled(bool)));
+ connect(m_view.clip_force_colorspace, SIGNAL(toggled(bool)), m_view.clip_colorspace, SLOT(setEnabled(bool)));
m_view.tabWidget->removeTab(METATAB);
m_view.tabWidget->removeTab(MARKERTAB);
} else if (m_old_props.contains("audio_index")) {
props["audio_index"].clear();
}
+
+ int colorspace = m_view.clip_colorspace->itemData(m_view.clip_colorspace->currentIndex()).toInt();
+ if (m_view.clip_force_colorspace->isChecked()) {
+ if (colorspace != m_old_props.value("force_colorspace").toInt()) {
+ props["force_colorspace"] = QString::number(colorspace);
+ m_clipNeedsRefresh = true;
+ }
+ } else if (m_old_props.contains("force_colorspace")) {
+ props["force_colorspace"].clear();
+ m_clipNeedsRefresh = true;
+ }
+
+ if (m_view.clip_full_luma->isChecked()) {
+ props["full_luma"] = QString::number(1);
+ m_clipNeedsRefresh = true;
+ } else if (m_old_props.contains("full_luma")) {
+ props["full_luma"].clear();
+ m_clipNeedsRefresh = true;
+ }
// If we adjust several clips, return now
if (m_clip == NULL) {
m_audioTrackProducers.at(track)->set("video_index", -1);
if (m_properties.contains("audio_index")) m_audioTrackProducers.at(track)->set("audio_index", m_properties.value("audio_index").toInt());
m_audioTrackProducers.at(track)->set("id", QString(getId() + '_' + QString::number(track) + "_audio").toUtf8().data());
+ if (m_properties.contains("force_colorspace")) m_audioTrackProducers.at(track)->set("force_colorspace", m_properties.value("force_colorspace").toInt());
+ if (m_properties.contains("full_luma")) m_audioTrackProducers.at(track)->set("set.force_full_luma", m_properties.value("full_luma").toInt());
}
return m_audioTrackProducers.at(track);
}
m_videoOnlyProducer->set("audio_index", -1);
if (m_properties.contains("video_index")) m_videoOnlyProducer->set("video_index", m_properties.value("video_index").toInt());
m_videoOnlyProducer->set("id", QString(getId() + "_video").toUtf8().data());
+ if (m_properties.contains("force_colorspace")) m_videoOnlyProducer->set("force_colorspace", m_properties.value("force_colorspace").toInt());
+ if (m_properties.contains("full_luma")) m_videoOnlyProducer->set("set.force_full_luma", m_properties.value("full_luma").toInt());
}
return m_videoOnlyProducer;
}
m_baseTrackProducers[track]->set("skip_loop_filter", "all");
m_baseTrackProducers[track]->set("skip_frame", "bidir");
}
+ if (m_properties.contains("force_colorspace")) m_baseTrackProducers[track]->set("force_colorspace", m_properties.value("force_colorspace").toInt());
+ if (m_properties.contains("full_luma")) m_baseTrackProducers[track]->set("set.force_full_luma", m_properties.value("full_luma").toInt());
}
return m_baseTrackProducers.at(track);
}
m_properties.remove("audio_index");
setProducerProperty("audio_index", m_properties.value("default_audio").toInt());
} else setProducerProperty("audio_index", value.toInt());
+ } else if (key == "force_colorspace") {
+ if (value.isEmpty()) {
+ m_properties.remove("force_colorspace");
+ resetProducerProperty("force_colorspace");
+ } else setProducerProperty("force_colorspace", value.toInt());
+ } else if (key == "full_luma") {
+ if (value.isEmpty()) {
+ m_properties.remove("full_luma");
+ resetProducerProperty("set.force_full_luma");
+ } else setProducerProperty("set.force_full_luma", value.toInt());
}
}
commonproperties.insert("threads", "-");
commonproperties.insert("video_index", "-");
commonproperties.insert("audio_index", "-");
+ commonproperties.insert("force_colorspace", "-");
+ commonproperties.insert("full_luma", "-");
bool allowDurationChange = true;
int commonDuration = -1;
} else if (properties.contains("colour") || properties.contains("xmldata") || properties.contains("force_aspect_ratio") || properties.contains("templatetext")) {
slotRefreshClipThumbnail(item);
emit refreshClip();
+ } else if (properties.contains("full_luma") || properties.contains("force_colorspace")) {
+ emit refreshClip();
}
}
}
int aindex = xml.attribute("audio_index").toInt();
if (aindex != 0) producer->set("audio_index", aindex);
}
+ if (xml.hasAttribute("force_colorspace")) {
+ int colorspace = xml.attribute("force_colorspace").toInt();
+ if (colorspace != 0) producer->set("force_colorspace", colorspace);
+ }
+ if (xml.hasAttribute("full_luma")) {
+ int full_luma = xml.attribute("full_luma").toInt();
+ if (full_luma != 0) producer->set("set.force_full_luma", full_luma);
+ }
// setup length here as otherwise default length (currently 15000 frames in MLT) will be taken even if outpoint is larger
if (xml.attribute("type").toInt() == COLOR || xml.attribute("type").toInt() == TEXT
slowprod->set("force_progressive", original->parent().get_int("force_progressive"));
int ix = original->parent().get_int("video_index");
if (ix != 0) slowprod->set("video_index", ix);
+ int colorspace = original->parent().get_int("force_colorspace");
+ if (colorspace != 0) slowprod->set("force_colorspace", colorspace);
+ int full_luma = original->parent().get_int("set.force_full_luma");
+ if (full_luma != 0) slowprod->set("set.force_full_luma", full_luma);
m_slowmotionProducers.insert(url, slowprod);
}
Mlt::Producer *clip = trackPlaylist.replace_with_blank(clipIndex);
if (threads != 0) slowprod->set("threads", threads);
int ix = original->parent().get_int("video_index");
if (ix != 0) slowprod->set("video_index", ix);
+ int colorspace = original->parent().get_int("force_colorspace");
+ if (colorspace != 0) slowprod->set("force_colorspace", colorspace);
+ int full_luma = original->parent().get_int("set.force_full_luma");
+ if (full_luma != 0) slowprod->set("set.force_full_luma", full_luma);
m_slowmotionProducers.insert(url, slowprod);
}
Mlt::Producer *clip = trackPlaylist.replace_with_blank(clipIndex);
<rect>
<x>0</x>
<y>0</y>
- <width>284</width>
- <height>458</height>
+ <width>306</width>
+ <height>478</height>
</rect>
</property>
<property name="windowTitle">
<string>Advanced</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
- <item row="8" column="2">
+ <item row="11" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
- <item row="5" column="2">
+ <item row="6" column="2">
<widget class="QSpinBox" name="clip_vindex">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="6" column="2">
+ <item row="7" column="2">
<widget class="QSpinBox" name="clip_aindex">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="4" column="1">
+ <item row="5" column="1">
<widget class="QCheckBox" name="clip_force_threads">
<property name="text">
<string>Decoding threads</string>
</property>
</widget>
</item>
- <item row="5" column="1">
+ <item row="6" column="1">
<widget class="QCheckBox" name="clip_force_vindex">
<property name="text">
<string>Video index</string>
</property>
</widget>
</item>
- <item row="6" column="1">
+ <item row="7" column="1">
<widget class="QCheckBox" name="clip_force_aindex">
<property name="text">
<string>Audio index</string>
</property>
</widget>
</item>
- <item row="4" column="2">
+ <item row="5" column="2">
<widget class="QSpinBox" name="clip_threads">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
+ <item row="8" column="1">
+ <widget class="QCheckBox" name="clip_force_colorspace">
+ <property name="text">
+ <string>Force colorspace</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="2">
+ <widget class="KComboBox" name="clip_colorspace">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="1">
+ <widget class="QCheckBox" name="clip_full_luma">
+ <property name="text">
+ <string>Full luma range</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</widget>