Fix changing composition track does not replug it.

Fixes #206. Workaround is to move the composition to another track and back or save and re-open project
parent 378c1db0
Pipeline #4110 passed with stage
in 30 minutes and 29 seconds
......@@ -698,25 +698,25 @@ void TimelineFunctions::setCompositionATrack(const std::shared_ptr<TimelineItemM
int start = timeline->getItemPosition(cid);
int end = start + timeline->getItemPlaytime(cid);
Fun local_redo = [timeline, cid, aTrack, autoTrack, start, end]() {
timeline->unplantComposition(cid);
QScopedPointer<Mlt::Field> field(timeline->m_tractor->field());
field->lock();
timeline->getCompositionPtr(cid)->setForceTrack(!autoTrack);
timeline->getCompositionPtr(cid)->setATrack(aTrack, aTrack <= 0 ? -1 : timeline->getTrackIndexFromPosition(aTrack - 1));
field->unlock();
QModelIndex modelIndex = timeline->makeCompositionIndexFromID(cid);
timeline->dataChanged(modelIndex, modelIndex, {TimelineModel::ItemATrack});
timeline->replantCompositions(cid, true);
timeline->invalidateZone(start, end);
timeline->checkRefresh(start, end);
return true;
};
Fun local_undo = [timeline, cid, previousATrack, previousAutoTrack, start, end]() {
timeline->unplantComposition(cid);
QScopedPointer<Mlt::Field> field(timeline->m_tractor->field());
field->lock();
timeline->getCompositionPtr(cid)->setForceTrack(previousAutoTrack == 0);
timeline->getCompositionPtr(cid)->setATrack(previousATrack, previousATrack <= 0 ? -1 : timeline->getTrackIndexFromPosition(previousATrack - 1));
field->unlock();
QModelIndex modelIndex = timeline->makeCompositionIndexFromID(cid);
timeline->dataChanged(modelIndex, modelIndex, {TimelineModel::ItemATrack});
timeline->replantCompositions(cid, true);
timeline->invalidateZone(start, end);
timeline->checkRefresh(start, end);
return true;
......
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