m_document = createEmptyDocument(tracks.x(), tracks.y());
}
+ KdenliveSettings::setCurrent_profile(profilePath());
+
// Set the video profile (empty == default)
// Make sure the project folder is usable
KStandardDirs::makeDir(m_projectFolder.path(KUrl::AddTrailingSlash) + "ladspa/");
kDebug() << "Kdenlive document, init timecode: " << m_fps;
- if (m_fps == 30000.0 / 1001.0) m_timecode.setFormat(30, true);
- else m_timecode.setFormat((int)(m_fps + 0.5));
+ if (m_fps == 30000.0 / 1001.0) m_timecode.setFormat(m_fps, true);
+ else m_timecode.setFormat(m_fps);
//kDebug() << "// SETTING SCENE LIST:\n\n" << m_document.toString();
connect(m_autoSaveTimer, SIGNAL(timeout()), this, SLOT(slotAutoSave()));
int KdenliveDoc::setSceneList()
{
+ m_render->resetProfile();
if (m_render->setSceneList(m_document.toString(), m_documentProperties.value("position").toInt()) == -1) {
// INVALID MLT Consumer, something is wrong
return -1;
audioTrack.isBlind = true;
audioTrack.isLocked = false;
+ // Create black producer
+ // For some unknown reason, we have to build the black producer here and not in renderer.cpp, otherwise
+ // the composite transitions with the black track are corrupted.
+ QDomElement blk = doc.createElement("producer");
+ blk.setAttribute("in", 0);
+ blk.setAttribute("out", 500);
+ blk.setAttribute("id", "black");
+
+ QDomElement property = doc.createElement("property");
+ property.setAttribute("name", "mlt_type");
+ QDomText value = doc.createTextNode("producer");
+ property.appendChild(value);
+ blk.appendChild(property);
+
+ property = doc.createElement("property");
+ property.setAttribute("name", "aspect_ratio");
+ value = doc.createTextNode(QString::number(0.0));
+ property.appendChild(value);
+ blk.appendChild(property);
+
+ property = doc.createElement("property");
+ property.setAttribute("name", "length");
+ value = doc.createTextNode(QString::number(15000));
+ property.appendChild(value);
+ blk.appendChild(property);
+
+ property = doc.createElement("property");
+ property.setAttribute("name", "eof");
+ value = doc.createTextNode("pause");
+ property.appendChild(value);
+ blk.appendChild(property);
+
+ property = doc.createElement("property");
+ property.setAttribute("name", "resource");
+ value = doc.createTextNode("black");
+ property.appendChild(value);
+ blk.appendChild(property);
+
+ property = doc.createElement("property");
+ property.setAttribute("name", "mlt_service");
+ value = doc.createTextNode("colour");
+ property.appendChild(value);
+ blk.appendChild(property);
+
+ mlt.appendChild(blk);
+
+
QDomElement tractor = doc.createElement("tractor");
tractor.setAttribute("id", "maintractor");
QDomElement multitrack = doc.createElement("multitrack");
playlist.setAttribute("id", "black_track");
mlt.appendChild(playlist);
+ QDomElement blank0 = doc.createElement("entry");
+ blank0.setAttribute("in", "0");
+ blank0.setAttribute("out", "0");
+ blank0.setAttribute("producer", "black");
+ playlist.appendChild(blank0);
// create playlists
int total = audiotracks + videotracks + 1;
m_width = m_profile.width;
m_height = m_profile.height;
kDebug() << "Kdenlive document, init timecode from path: " << path << ", " << m_fps;
- if (m_fps == 30000.0 / 1001.0) m_timecode.setFormat(30, true);
- else m_timecode.setFormat((int)(m_fps + 0.5));
+ if (m_fps == 30000.0 / 1001.0) m_timecode.setFormat(m_fps, true);
+ else m_timecode.setFormat(m_fps);
}
double KdenliveDoc::dar()
int KdenliveDoc::getFramePos(QString duration)
{
- return m_timecode.getFrameCount(duration, m_fps);
+ return m_timecode.getFrameCount(duration);
}
QString KdenliveDoc::producerName(const QString &id)