Commit b4c0505c authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix mix direction lost on save / change track, fix clip offset on vertical...

Fix mix direction lost on save / change track, fix clip offset on vertical move while deleting start mix
parent 66b95243
......@@ -9,4 +9,7 @@
<parameter type="double" name="softness" max="100" min="0" default="0" factor="100">
<name>Softness</name>
</parameter>
<parameter type="bool" name="reverse" max="1" min="0" default="0">
<name>Reverse</name>
</parameter>
</transition>
......@@ -691,6 +691,7 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
if (moving_clips.contains(mixData.first.firstClipId)) {
allowedClipMixes << mixData.first.firstClipId;
} else if (finalMove) {
position += (mixData.first.firstClipInOut.second - mixData.first.secondClipInOut.first - mixData.first.mixOffset);
removeMixWithUndo(clipId, local_undo, local_redo);
}
}
......@@ -741,6 +742,7 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
}
} else {
// Clip moved to another track, delete mix
position += (m_allClips[clipId]->getMixDuration() - m_allClips[clipId]->getMixCutPosition());
removeMixWithUndo(clipId, local_undo, local_redo);
}
}
......
......@@ -1998,6 +1998,7 @@ std::pair<MixInfo, MixInfo> TrackModel::getMixInfo(int clipId) const
startMix.firstClipInOut.second = startMix.firstClipInOut.first + clip1->getPlaytime();
startMix.secondClipInOut.first = clip2->getPosition();
startMix.secondClipInOut.second = startMix.secondClipInOut.first + clip2->getPlaytime();
startMix.mixOffset = clip2->getMixCutPosition();
} else {
// Clip was deleted
startMix.firstClipId = -1;
......
......@@ -43,9 +43,12 @@ class MixInfo
public:
int firstClipId = -1;
int secondClipId = -1;
/** @brief in and out of the first clip in the mix */
std::pair<int, int> firstClipInOut;
/** @brief in and out of the second clip in the mix */
std::pair<int, int> secondClipInOut;
std::pair<int, int> mixInOut;
/** @brief Distance between first clip out and cut pos */
int mixOffset;
};
/** @brief This class represents a Track object, as viewed by the backend.
......
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