Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Improve composition track indicator erronous behavior

parent d6f1ff1f
......@@ -1498,13 +1498,12 @@ bool TimelineModel::replantCompositions(int currentCompo)
unplantComposition(compo.first);
}
}
// sort by decreasing b_track
std::sort(compos.begin(), compos.end(), [](const std::pair<int, int> &a, const std::pair<int, int> &b) { return a.first > b.first; });
// replant
QScopedPointer<Mlt::Field> field(m_tractor->field());
field->lock();
// Unplant track compositing
mlt_service nextservice = mlt_service_get_producer(field->get_service());
mlt_properties properties = MLT_SERVICE_PROPERTIES(nextservice);
......@@ -1532,7 +1531,7 @@ bool TimelineModel::replantCompositions(int currentCompo)
}
// Sort track compositing
std::sort(trackCompositions.begin(), trackCompositions.end(), [](Mlt::Transition *a, Mlt::Transition *b) { return a->get_b_track() < b->get_b_track(); });
for (const auto &compo : compos) {
int aTrack = m_allCompositions[compo.second]->getATrack();
Q_ASSERT(aTrack != -1);
......@@ -1543,7 +1542,7 @@ bool TimelineModel::replantCompositions(int currentCompo)
field->plant_transition(*firstTr, firstTr->get_a_track(), compositingB);
}
}
int ret = field->plant_transition(*m_allCompositions[compo.second].get(), aTrack, compo.first);
qDebug() << "Planting composition " << compo.second << "in " << aTrack << "/" << compo.first << "IN = " << m_allCompositions[compo.second]->getIn()
<< "OUT = " << m_allCompositions[compo.second]->getOut() << "ret=" << ret;
......@@ -1557,7 +1556,6 @@ bool TimelineModel::replantCompositions(int currentCompo)
return false;
}
}
// Replant last tracks compositing
while (!trackCompositions.isEmpty()) {
Mlt::Transition *firstTr = trackCompositions.takeFirst();
......
......@@ -873,11 +873,9 @@ Fun TrackModel::requestCompositionInsertion_lambda(int compoId, int position, bo
int new_out = new_in + composition->getPlaytime();
composition->setInOut(new_in, new_out - 1);
if (updateView) {
qDebug() << "* * *ADDING COMPOSITION ON TK: " << composition->getCurrentTrackId();
int composition_index = getRowfromComposition(composition->getId());
ptr->_beginInsertRows(ptr->makeTrackIndexFromID(composition->getCurrentTrackId()), composition_index, composition_index);
ptr->_endInsertRows();
qDebug() << "* * *ADDING COMPOSITION DONE TK: " << composition->getCurrentTrackId();
}
ptr->m_snaps->addPoint(new_in);
ptr->m_snaps->addPoint(new_out);
......
......@@ -248,11 +248,9 @@ Rectangle {
onReleased: {
root.stopScrolling = false
var delta = parent.x - startX
var moved = false
drag.target = undefined
cursorShape = Qt.OpenHandCursor
if (trackId !== originalTrackId) {
moved = true
var track = Logic.getTrackById(trackId)
parent.moved(clipRoot)
reparent(track)
......@@ -261,7 +259,6 @@ Rectangle {
originalTrackId = trackId
} else if (Math.abs(delta) >= 1.0) {
parent.dropped(clipRoot)
moved = true;
originalX = parent.x
}
}
......
......@@ -71,8 +71,13 @@ Item {
signal trimmingOut(var clip, real newDuration, var mouse)
signal trimmedOut(var clip)
onATrackChanged: {
if (compositionRoot.aTrack > 0 && compositionRoot.trackId > 0) {
targetTrack.y = root.getTrackYFromMltIndex(compositionRoot.aTrack) - root.getTrackYFromId(compositionRoot.trackId)
}
}
onKeyframeModelChanged: {
console.log('keyframe model changed............')
if (effectRow.keyframecanvas) {
effectRow.keyframecanvas.requestPaint()
}
......@@ -98,6 +103,12 @@ Item {
isAudio = track.isAudio
parentTrack = track
displayHeight = track.height / 2
compositionRoot.trackId = parentTrack.trackId
}
onTrackIdChanged: {
if (compositionRoot.aTrack > 0 && compositionRoot.trackId > 0) {
targetTrack.y = root.getTrackYFromMltIndex(compositionRoot.aTrack) - root.getTrackYFromId(compositionRoot.trackId)
}
}
SystemPalette { id: activePalette }
......@@ -323,8 +334,9 @@ Item {
GradientStop { position: 0.0; color: selected ? 'red' : 'mediumpurple' }
GradientStop { position: 1.0; color: "#00000000" }
}
visible: compositionRoot.aTrack > 0
visible: compositionRoot.aTrack > 0 && compositionRoot.trackId > 0
y: root.getTrackYFromMltIndex(compositionRoot.aTrack) - parentTrack.mapToItem(null, 0, 0).y + ruler.height
//y: root.getTrackYFromMltIndex(compositionRoot.aTrack) - root.getTrackYFromId(compositionRoot.trackId)
height: clabel.height + 4
Text {
id: clabel
......
......@@ -213,10 +213,9 @@ Column{
//item.aTrack = model.a_track
}
item.trackId= trackRoot.trackId
//hash= model.hash
item.speed= 1 //model.speed
//item.selected= trackRoot.selection.indexOf(item.clipId) !== -1
console.log(width, height);
//console.log(width, height);
}
}
}
......
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