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);
+ 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()));
KdenliveDoc::~KdenliveDoc()
{
+ m_autoSaveTimer->stop();
delete m_commandStack;
+ kDebug() << "// DEL CLP MAN";
delete m_clipManager;
+ kDebug() << "// DEL CLP MAN done";
delete m_autoSaveTimer;
if (m_autosave) {
if (!m_autosave->fileName().isEmpty()) m_autosave->remove();
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);
+ 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)
if (elem.attribute("type").toInt() == SLIDESHOW) {
extension = KUrl(path).fileName();
path = KUrl(path).directory();
- } else if (elem.attribute("type").toInt() == TEXT && QFile::exists(path) == false) {
+ } /*else if (elem.attribute("type").toInt() == TEXT && QFile::exists(path) == false) {
kDebug() << "// TITLE: " << elem.attribute("name") << " Preview file: " << elem.attribute("resource") << " DOES NOT EXIST";
QString titlename = elem.attribute("name");
QString titleresource;
elem.setAttribute("resource", titleresource);
setNewClipResource(clipId, titleresource);
delete dia_ui;
- }
+ }*/
if (path.isEmpty() == false && QFile::exists(path) == false && elem.attribute("type").toInt() != TEXT && !elem.hasAttribute("placeholder")) {
kDebug() << "// FOUND MISSING CLIP: " << path << ", TYPE: " << elem.attribute("type").toInt();
void KdenliveDoc::deleteClip(const QString &clipId)
{
emit signalDeleteProjectClip(clipId);
- m_clipManager->deleteClip(clipId);
}
void KdenliveDoc::slotAddClipList(const KUrl::List urls, const QString group, const QString &groupId)
{
QString titlesFolder = projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
KStandardDirs::makeDir(titlesFolder);
- TitleWidget *dia_ui = new TitleWidget(templatePath, titlesFolder, m_render, kapp->activeWindow());
+ TitleWidget *dia_ui = new TitleWidget(templatePath, m_timecode, titlesFolder, m_render, kapp->activeWindow());
if (dia_ui->exec() == QDialog::Accepted) {
- QStringList titleInfo = TitleWidget::getFreeTitleInfo(projectFolder());
+ /*QStringList titleInfo = TitleWidget::getFreeTitleInfo(projectFolder());
QImage pix = dia_ui->renderedPixmap();
- pix.save(titleInfo.at(1));
+ pix.save(titleInfo.at(1));*/
//dia_ui->saveTitle(path + ".kdenlivetitle");
- m_clipManager->slotAddTextClipFile(titleInfo.at(0), titleInfo.at(1), dia_ui->xml().toString(), group, groupId);
+ m_clipManager->slotAddTextClipFile(i18n("Title clip"), dia_ui->duration(), dia_ui->xml().toString(), group, groupId);
setModified(true);
emit selectLastAddedClip(QString::number(m_clipManager->lastClipId()));
}
QStringList titleInfo = TitleWidget::getFreeTitleInfo(projectFolder(), true);
- TitleWidget *dia_ui = new TitleWidget(path, titlesFolder, m_render, kapp->activeWindow());
+ //TODO: rewrite with new title system (just set resource)
+ /*TitleWidget *dia_ui = new TitleWidget(path, titlesFolder, m_render, kapp->activeWindow());
QImage pix = dia_ui->renderedPixmap();
pix.save(titleInfo.at(1));
delete dia_ui;
m_clipManager->slotAddTextTemplateClip(titleInfo.at(0), titleInfo.at(1), path, group, groupId);
- setModified(true);
+ setModified(true);*/
emit selectLastAddedClip(QString::number(m_clipManager->lastClipId()));
}