Save track compositing mode in project to restore it on load

Fix compositing broken for first track if we have a video only project after switching compositing mode
BUG: 408081
parent a8874a4d
Pipeline #4023 passed with stage
in 28 minutes and 23 seconds
......@@ -875,6 +875,12 @@ bool ProjectManager::updateTimeline(int pos, int scrollPos)
qDebug()<<"// Project failed to load!!";
}
const QString groupsData = m_project->getDocumentProperty(QStringLiteral("groups"));
// update track compositing
int compositing = pCore->currentDoc()->getDocumentProperty(QStringLiteral("compositing"), QStringLiteral("2")).toInt();
pCore->currentDoc()->updateCompositionMode(compositing);
if (compositing < 2) {
pCore->window()->getMainTimeline()->controller()->switchCompositing(compositing);
}
if (!groupsData.isEmpty()) {
m_mainTimelineModel->loadGroups(groupsData);
}
......
......@@ -1480,6 +1480,7 @@ void TimelineController::changeItemSpeed(int clipId, double speed)
void TimelineController::switchCompositing(int mode)
{
// m_model->m_tractor->lock();
pCore->currentDoc()->setDocumentProperty(QStringLiteral("compositing"), QString::number(mode));
QScopedPointer<Mlt::Service> service(m_model->m_tractor->field());
Mlt::Field *field = m_model->m_tractor->field();
field->lock();
......@@ -1499,7 +1500,7 @@ void TimelineController::switchCompositing(int mode)
QStringLiteral("0=0/0:%1x%2").arg(m_model->m_tractor->profile()->width()).arg(m_model->m_tractor->profile()->height());
// Loop through tracks
for (int track = 1; track < m_model->getTracksCount(); track++) {
for (int track = 0; track < m_model->getTracksCount(); track++) {
if (m_model->getTrackById(m_model->getTrackIndexFromPosition(track))->getProperty("kdenlive:audio_track").toInt() == 0) {
// This is a video track
Mlt::Transition t(*m_model->m_tractor->profile(),
......
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