Commit 6606ae8c authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

debug stuff for possible qml producer

parent 03479a84
Pipeline #13368 passed with stage
in 13 minutes and 41 seconds
...@@ -562,7 +562,7 @@ std::shared_ptr<Mlt::Producer> ProjectClip::getTimelineProducer(int trackId, int ...@@ -562,7 +562,7 @@ std::shared_ptr<Mlt::Producer> ProjectClip::getTimelineProducer(int trackId, int
if (qFuzzyCompare(speed, 1.0)) { if (qFuzzyCompare(speed, 1.0)) {
// we are requesting a normal speed producer // we are requesting a normal speed producer
if (trackId == -1 || if (trackId == -1 ||
(state == PlaylistState::VideoOnly && (m_clipType == ClipType::Color || m_clipType == ClipType::Image || m_clipType == ClipType::Text))) { (state == PlaylistState::VideoOnly && (m_clipType == ClipType::Color || m_clipType == ClipType::Image || m_clipType == ClipType::Text || m_clipType == ClipType::Qml))) {
// Temporary copy, return clone of master // Temporary copy, return clone of master
int duration = m_masterProducer->time_to_frames(m_masterProducer->get("kdenlive:duration")); int duration = m_masterProducer->time_to_frames(m_masterProducer->get("kdenlive:duration"));
return std::shared_ptr<Mlt::Producer>(m_masterProducer->cut(-1, duration > 0 ? duration : -1)); return std::shared_ptr<Mlt::Producer>(m_masterProducer->cut(-1, duration > 0 ? duration : -1));
......
...@@ -107,7 +107,8 @@ enum ProducerType { ...@@ -107,7 +107,8 @@ enum ProducerType {
TextTemplate = 11, TextTemplate = 11,
QText = 12, QText = 12,
Composition = 13, Composition = 13,
Track = 14 Track = 14,
Qml = 15
}; };
Q_ENUM_NS(ProducerType) Q_ENUM_NS(ProducerType)
} // namespace ClipType } // namespace ClipType
......
...@@ -76,6 +76,10 @@ ClipType::ProducerType getTypeForService(const QString &id, const QString &path) ...@@ -76,6 +76,10 @@ ClipType::ProducerType getTypeForService(const QString &id, const QString &path)
if (id == QLatin1String("webvfx")) { if (id == QLatin1String("webvfx")) {
return ClipType::WebVfx; return ClipType::WebVfx;
} }
if (id == QLatin1String("qml")) {
return ClipType::Qml;
}
return ClipType::Unknown; return ClipType::Unknown;
} }
...@@ -320,6 +324,24 @@ bool LoadJob::startJob() ...@@ -320,6 +324,24 @@ bool LoadJob::startJob()
case ClipType::QText: case ClipType::QText:
m_producer = loadResource(m_resource, QStringLiteral("qtext:")); m_producer = loadResource(m_resource, QStringLiteral("qtext:"));
break; break;
case ClipType::Qml: {
bool ok;
int producerLength = 0;
QString pLength = Xml::getXmlProperty(m_xml, QStringLiteral("length"));
if (pLength.isEmpty()) {
producerLength = m_xml.attribute(QStringLiteral("length")).toInt();
} else {
producerLength = pLength.toInt(&ok);
}
if (producerLength <= 0) {
producerLength = pCore->currentDoc()->getFramePos(KdenliveSettings::title_duration());
}
m_producer = loadResource(m_resource, QStringLiteral("qml:"));
m_producer->set("length", producerLength);
m_producer->set("kdenlive:duration", producerLength);
m_producer->set("out", producerLength - 1);
break;
}
case ClipType::Playlist: { case ClipType::Playlist: {
m_producer = loadPlaylist(m_resource); m_producer = loadPlaylist(m_resource);
if (!m_errorMessage.isEmpty()) { if (!m_errorMessage.isEmpty()) {
......
...@@ -252,6 +252,9 @@ void ClipController::getInfoForProducer() ...@@ -252,6 +252,9 @@ void ClipController::getInfoForProducer()
m_clipType = ClipType::WebVfx; m_clipType = ClipType::WebVfx;
} else if (m_service == QLatin1String("qtext")) { } else if (m_service == QLatin1String("qtext")) {
m_clipType = ClipType::QText; m_clipType = ClipType::QText;
} else if (m_service == QLatin1String("qml")) {
m_clipType = ClipType::Qml;
m_hasLimitedDuration = false;
} else if (m_service == QLatin1String("blipflash")) { } else if (m_service == QLatin1String("blipflash")) {
// Mostly used for testing // Mostly used for testing
m_clipType = ClipType::AV; m_clipType = ClipType::AV;
......
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