Compare commits

...

2 Commits

Author SHA1 Message Date
Vincent Pinon
46e20dcceb Fix editing title file 2016-06-09 19:50:38 +02:00
Jean-Baptiste Mardelle
994606ee86 Backport fix audio mixing and possible corruption on add track 2016-06-08 09:00:29 +02:00
3 changed files with 21 additions and 0 deletions

View File

@@ -2862,9 +2862,13 @@ void Bin::showTitleWidget(ProjectClip *clip)
QString titlepath = m_doc->projectFolder().path() + QDir::separator() + "titles/";
TitleWidget dia_ui(QUrl(), m_doc->timecode(), titlepath, pCore->monitorManager()->projectMonitor()->render, pCore->window());
connect(&dia_ui, SIGNAL(requestBackgroundFrame()), pCore->monitorManager()->projectMonitor(), SLOT(slotGetCurrentImage()));
if (!path.isEmpty()) {
dia_ui.loadTitle(QUrl::fromLocalFile(path));
} else {
QDomDocument doc;
doc.setContent(clip->getProducerProperty(QStringLiteral("xmldata")));
dia_ui.setXml(doc);
}
if (dia_ui.exec() == QDialog::Accepted) {
QMap <QString, QString> newprops;
newprops.insert(QStringLiteral("xmldata"), dia_ui.xml().toString());

View File

@@ -356,6 +356,8 @@ QDomDocument KdenliveDoc::createEmptyDocument(const QList <TrackInfo> &tracks)
QDomElement blk = doc.createElement(QStringLiteral("producer"));
blk.setAttribute(QStringLiteral("in"), 0);
blk.setAttribute(QStringLiteral("out"), 500);
blk.setAttribute(QStringLiteral("aspect_ratio"), 1);
blk.setAttribute(QStringLiteral("set.test_audio"), 0);
blk.setAttribute(QStringLiteral("id"), QStringLiteral("black"));
QDomElement property = doc.createElement(QStringLiteral("property"));

View File

@@ -81,6 +81,8 @@ Render::Render(Kdenlive::MonitorId rendererName, BinController *binController, G
m_blackClip = new Mlt::Producer(*m_qmlView->profile(), "colour:black");
m_blackClip->set("id", "black");
m_blackClip->set("mlt_type", "producer");
m_blackClip->set("aspect_ratio", 1);
m_blackClip->set("set.test_audio", 0);
m_mltProducer = m_blackClip->cut(0, 1);
m_qmlView->setProducer(m_mltProducer);
m_mltConsumer = qmlView->consumer();
@@ -2106,8 +2108,21 @@ QList <TransitionInfo> Render::mltInsertTrack(int ix, const QString &name, bool
blockSignals(true);
service.lock();
Mlt::Tractor tractor(service);
// Find available track name
QStringList trackNames;
for (int i = 0; i < tractor.count(); i++) {
QScopedPointer<Mlt::Producer> track(tractor.track(i));
trackNames << track->get("id");
}
QString newName = QStringLiteral("playlist0");
int i = 1;
while (trackNames.contains(newName)) {
newName = QString("playlist%1").arg(i);
i++;
}
Mlt::Playlist playlist(*service.profile());
playlist.set("kdenlive:track_name", name.toUtf8().constData());
playlist.set("id", newName.toUtf8().constData());
int ct = tractor.count();
if (ix > ct) {
//qDebug() << "// ERROR, TRYING TO insert TRACK " << ix << ", max: " << ct;