projectTrack.isMute = e.attribute("mute").toInt();
projectTrack.isBlind = e.attribute("blind").toInt();
projectTrack.isLocked = e.attribute("locked").toInt();
+ projectTrack.trackName = e.attribute("trackname");
m_tracksList.append(projectTrack);
}
}
}
}
}
- } else setProfilePath(profileName);
+ }
// Something went wrong, or a new file was requested: create a new project
if (!success) {
- setProfilePath(QString());
+ setProfilePath(profileName);
m_url = KUrl();
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;
trackinfo.setAttribute("mute", info.isMute);
trackinfo.setAttribute("blind", info.isBlind);
trackinfo.setAttribute("locked", info.isLocked);
+ trackinfo.setAttribute("trackname", info.trackName);
tracksinfo.appendChild(trackinfo);
}
addedXml.appendChild(tracksinfo);
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()
{
m_clipManager->updatePreviewSettings();
m_render->updatePreviewSettings();
+ QList <Mlt::Producer *> prods = m_render->producersList();
m_clipManager->resetProducersList(m_render->producersList());
-
+ qDeleteAll(prods);
+ prods.clear();
}
Render *KdenliveDoc::renderer()
return m_render;
}
-void KdenliveDoc::updateClip(const QString &id)
+void KdenliveDoc::updateClip(const QString id)
{
emit updateClipDisplay(id);
}
int KdenliveDoc::getFramePos(QString duration)
{
- return m_timecode.getFrameCount(duration, m_fps);
+ return m_timecode.getFrameCount(duration);
}
QString KdenliveDoc::producerName(const QString &id)
m_tracksList[ix].isMute = type.isMute;
m_tracksList[ix].isBlind = type.isBlind;
m_tracksList[ix].isLocked = type.isLocked;
+ m_tracksList[ix].trackName = type.trackName;
}
const QList <TrackInfo> KdenliveDoc::tracksList() const