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

Fix various mix move issue and tests

parent 058b8e88
......@@ -696,7 +696,7 @@ bool TimelineFunctions::removeSpace(const std::shared_ptr<TimelineItemModel> &ti
int targetPos = timeline->getItemPosition(itemId) + zone.x() - zone.y();
if (timeline->m_groups->isInGroup(itemId)) {
result = timeline->requestGroupMove(itemId, timeline->m_groups->getRootId(itemId), 0, zone.x() - zone.y(), true, true, undo, redo, true, true, allowedTracks);
result = timeline->requestGroupMove(itemId, timeline->m_groups->getRootId(itemId), 0, zone.x() - zone.y(), true, true, undo, redo, true, true, true, allowedTracks);
} else if (timeline->isClip(itemId)) {
result = timeline->requestClipMove(itemId, targetTrackId, targetPos, true, true, true, true, undo, redo);
} else {
......@@ -737,7 +737,7 @@ bool TimelineFunctions::requestInsertSpace(const std::shared_ptr<TimelineItemMod
// TODO the three move functions should be unified in a "requestItemMove" function
if (timeline->m_groups->isInGroup(itemId)) {
result =
result && timeline->requestGroupMove(itemId, timeline->m_groups->getRootId(itemId), 0, zone.y() - zone.x(), true, true, local_undo, local_redo, true, true, allowedTracks);
result && timeline->requestGroupMove(itemId, timeline->m_groups->getRootId(itemId), 0, zone.y() - zone.x(), true, true, local_undo, local_redo, true, true, true, allowedTracks);
} else if (timeline->isClip(itemId)) {
result = result && timeline->requestClipMove(itemId, targetTrackId, targetPos, true, true, true, true, local_undo, local_redo);
} else {
......
......@@ -617,7 +617,7 @@ bool TimelineModel::requestFakeClipMove(int clipId, int trackId, int position, b
return false;
}
bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool moveMirrorTracks, bool updateView, bool invalidateTimeline, bool finalMove, Fun &undo, Fun &redo, bool groupMove, QMap <int, int> moving_clips, std::pair<MixInfo,MixInfo>mixData)
bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool moveMirrorTracks, bool updateView, bool invalidateTimeline, bool finalMove, Fun &undo, Fun &redo, bool revertMove, bool groupMove, QMap <int, int> moving_clips, std::pair<MixInfo,MixInfo>mixData)
{
Q_UNUSED(moveMirrorTracks)
if (trackId == -1) {
......@@ -666,6 +666,22 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
if (!groupMove && old_trackId > -1) {
mixData = getTrackById_const(old_trackId)->getMixInfo(clipId);
}
if (old_trackId == trackId && !finalMove && !revertMove) {
if (mixData.first.firstClipId > -1 && !moving_clips.contains(mixData.first.firstClipId)) {
// Mix at clip start, don't allow moving left
if (position < getClipPosition(clipId)) {
qDebug()<<"==== ABORTING GROUP MOVE ON START MIX";
return false;
}
}
if (mixData.second.firstClipId > -1 && !moving_clips.contains(mixData.second.secondClipId)) {
// Mix at clip end, don't allow moving right
if (position > getClipPosition(clipId)) {
qDebug()<<"==== ABORTING GROUP MOVE ON END MIX";
return false;
}
}
}
bool hadMix = mixData.first.firstClipId > -1 || mixData.second.secondClipId > -1;
if (old_trackId == -1 && isTrack(previous_track) && hadMix && previous_track != trackId) {
// Clip is moved to another track
......@@ -717,9 +733,10 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
// Clip has a mix
if (mixData.first.firstClipId > -1) {
if (old_trackId == trackId) {
int mixCut = m_allClips[clipId]->getMixCutPosition();
// We are moving a clip on same track
if (position >= mixData.first.firstClipInOut.second) {
position += m_allClips[clipId]->getMixDuration() - m_allClips[clipId]->getMixCutPosition();
if (position > mixData.first.secondClipInOut.first - mixCut) {
position += m_allClips[clipId]->getMixDuration() - mixCut;
removeMixWithUndo(clipId, local_undo, local_redo);
}
} else {
......@@ -729,13 +746,13 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
}
if (mixData.second.firstClipId > -1) {
// We have a mix at clip end
int clipDuration = mixData.second.firstClipInOut.second - mixData.second.firstClipInOut.first;
sync_mix = [this, old_trackId, finalMove]() {
getTrackById_const(old_trackId)->syncronizeMixes(finalMove);
return true;
};
if (old_trackId == trackId) {
if (finalMove && (position + clipDuration <= mixData.second.secondClipInOut.first)) {
int mixEnd = m_allClips[mixData.second.secondClipId]->getPosition() + m_allClips[mixData.second.secondClipId]->getMixDuration();
if (finalMove && mixEnd > position + m_allClips[clipId]->getPlaytime()) {
// Moved outside mix zone
removeMixWithUndo(mixData.second.secondClipId, local_undo, local_redo);
}
......@@ -750,8 +767,9 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
if (mixData.first.firstClipId > -1) {
// Mix on clip start, check if mix is still in range
if (!moving_clips.contains(mixData.first.firstClipId)) {
int mixEnd = m_allClips[mixData.first.firstClipId]->getPosition() + m_allClips[mixData.first.firstClipId]->getPlaytime();
if (mixEnd < position) {
int mixCut = m_allClips[clipId]->getMixCutPosition();
// We are moving a clip on same track
if (position > mixData.first.secondClipInOut.first - mixCut) {
// Mix will be deleted, recreate on undo
position += m_allClips[mixData.first.secondClipId]->getMixDuration() - m_allClips[mixData.first.secondClipId]->getMixCutPosition();
removeMixWithUndo(mixData.first.secondClipId, local_undo, local_redo);
......@@ -763,7 +781,7 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
if (mixData.second.firstClipId > -1) {
// Mix on clip end, check if mix is still in range
if (!moving_clips.contains(mixData.second.secondClipId)) {
int mixEnd = m_allClips[mixData.second.secondClipId]->getPosition();
int mixEnd = m_allClips[mixData.second.secondClipId]->getPosition() + m_allClips[mixData.second.secondClipId]->getMixDuration();
if (mixEnd > position + m_allClips[clipId]->getPlaytime()) {
// Mix will be deleted, recreate on undo
removeMixWithUndo(mixData.second.secondClipId, local_undo, local_redo);
......@@ -1023,7 +1041,7 @@ bool TimelineModel::requestFakeClipMove(int clipId, int trackId, int position, b
return res;
}
bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool moveMirrorTracks, bool updateView, bool logUndo, bool invalidateTimeline)
bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool moveMirrorTracks, bool updateView, bool logUndo, bool invalidateTimeline, bool revertMove)
{
QWriteLocker locker(&m_lock);
TRACE(clipId, trackId, position, updateView, logUndo, invalidateTimeline);
......@@ -1040,11 +1058,11 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
int track_pos2 = getTrackPosition(current_trackId);
int delta_track = track_pos1 - track_pos2;
int delta_pos = position - m_allClips[clipId]->getPosition();
return requestGroupMove(clipId, groupId, delta_track, delta_pos, moveMirrorTracks, updateView, logUndo);
return requestGroupMove(clipId, groupId, delta_track, delta_pos, moveMirrorTracks, updateView, logUndo, revertMove);
}
std::function<bool(void)> undo = []() { return true; };
std::function<bool(void)> redo = []() { return true; };
bool res = requestClipMove(clipId, trackId, position, moveMirrorTracks, updateView, invalidateTimeline, logUndo, undo, redo);
bool res = requestClipMove(clipId, trackId, position, moveMirrorTracks, updateView, invalidateTimeline, logUndo, undo, redo, revertMove);
if (res && logUndo) {
PUSH_UNDO(undo, redo, i18n("Move clip"));
}
......@@ -1128,7 +1146,7 @@ bool TimelineModel::requestClipMoveAttempt(int clipId, int trackId, int position
int track_pos2 = getTrackPosition(current_trackId);
int delta_track = track_pos1 - track_pos2;
int delta_pos = position - m_allClips[clipId]->getPosition();
res = requestGroupMove(clipId, groupId, delta_track, delta_pos, false, false, undo, redo, false);
res = requestGroupMove(clipId, groupId, delta_track, delta_pos, false, false, undo, redo, false, false);
} else {
res = requestClipMove(clipId, trackId, position, true, false, false, false, undo, redo);
}
......@@ -2114,13 +2132,13 @@ bool TimelineModel::requestFakeGroupMove(int clipId, int groupId, int delta_trac
return true;
}
bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, int delta_pos, bool moveMirrorTracks, bool updateView, bool logUndo)
bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, int delta_pos, bool moveMirrorTracks, bool updateView, bool logUndo, bool revertMove)
{
QWriteLocker locker(&m_lock);
TRACE(itemId, groupId, delta_track, delta_pos, updateView, logUndo);
std::function<bool(void)> undo = []() { return true; };
std::function<bool(void)> redo = []() { return true; };
bool res = requestGroupMove(itemId, groupId, delta_track, delta_pos, updateView, logUndo, undo, redo, moveMirrorTracks);
bool res = requestGroupMove(itemId, groupId, delta_track, delta_pos, updateView, logUndo, undo, redo, revertMove, moveMirrorTracks);
if (res && logUndo) {
PUSH_UNDO(undo, redo, i18n("Move group"));
}
......@@ -2128,7 +2146,7 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
return res;
}
bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, int delta_pos, bool updateView, bool finalMove, Fun &undo, Fun &redo, bool moveMirrorTracks,
bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, int delta_pos, bool updateView, bool finalMove, Fun &undo, Fun &redo, bool revertMove, bool moveMirrorTracks,
bool allowViewRefresh, QVector<int> allowedTracks)
{
QWriteLocker locker(&m_lock);
......@@ -2325,7 +2343,6 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
getTrackById(i.value())->requestRemoveMix(i.key(), local_undo, local_redo);
}
}
// First, remove clips
if (delta_track != 0) {
// We delete our clips only if changing track
......@@ -2392,8 +2409,10 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
if (delta_pos < 0) {
if (getTrackById_const(current_track_id)->hasStartMix(item.first)) {
subPlaylist = m_allClips[item.first]->getSubPlaylistIndex();
} else {
qDebug()<<"==== CLIP DOES NOT HAVE A START MIX!!!!!!!!";
}
if (!getTrackById_const(current_track_id)->isAvailable(target_position, playtime, subPlaylist)) {
if (!getTrackById_const(current_track_id)->isAvailable(target_position, qMin(qAbs(delta_pos), playtime), subPlaylist)) {
if (!getTrackById_const(current_track_id)->isBlankAt(current_in - 1)) {
// No move possible, abort
bool undone = local_undo();
......@@ -2410,6 +2429,7 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
subPlaylist = m_allClips[item.first]->getSubPlaylistIndex();
}
if (!getTrackById_const(current_track_id)->isAvailable(moveStart, moveEnd - moveStart, subPlaylist)) {
qDebug()<<"===== REQUESTING GRP MOVE ABORT 5, POSITION: "<<moveStart<<" - "<<(moveEnd - moveStart)<<" ON PLAYL: "<<subPlaylist<<" FOR CLIP: "<<item.first;
int newStart = getTrackById_const(current_track_id)->getBlankEnd(current_in + playtime, subPlaylist);
if (newStart == current_in + playtime) {
// No move possible, abort
......@@ -2429,7 +2449,7 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
}
int current_in = item.second;
int target_position = current_in + delta_pos;
ok = requestClipMove(item.first, current_track_id, target_position, moveMirrorTracks, updateThisView, finalMove, finalMove, local_undo, local_redo, true, oldTrackIds, mixDataArray.contains(item.first) ? mixDataArray.value(item.first) : std::pair<MixInfo,MixInfo>());
ok = requestClipMove(item.first, current_track_id, target_position, moveMirrorTracks, updateThisView, finalMove, finalMove, local_undo, local_redo, revertMove, true, oldTrackIds, mixDataArray.contains(item.first) ? mixDataArray.value(item.first) : std::pair<MixInfo,MixInfo>());
if (!ok) {
qWarning() << "failed moving clip on track " << current_track_id;
break;
......@@ -2472,7 +2492,7 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
std::advance(it, target_track_position);
int target_track = (*it)->getId();
int target_position = old_position[item.first] + delta_pos;
ok = ok && requestClipMove(item.first, target_track, target_position, moveMirrorTracks, updateThisView, finalMove, finalMove, local_undo, local_redo, true, oldTrackIds, mixDataArray.contains(item.first) ? mixDataArray.value(item.first) : std::pair<MixInfo,MixInfo>());
ok = ok && requestClipMove(item.first, target_track, target_position, moveMirrorTracks, updateThisView, finalMove, finalMove, local_undo, local_redo, revertMove, true, oldTrackIds, mixDataArray.contains(item.first) ? mixDataArray.value(item.first) : std::pair<MixInfo,MixInfo>());
} else {
ok = false;
}
......@@ -5319,8 +5339,12 @@ void TimelineModel::switchComposition(int cid, const QString &compoId)
void TimelineModel::plantMix(int tid, Mlt::Transition *t)
{
getTrackById_const(tid)->getTrackService()->plant_transition(*t, 0, 1);
getTrackById_const(tid)->loadMix(t);
if (getTrackById_const(tid)->hasClipStart(t->get_in())) {
getTrackById_const(tid)->getTrackService()->plant_transition(*t, 0, 1);
getTrackById_const(tid)->loadMix(t);
} else {
qDebug()<<"=== INVALID MIX FOUND AT: "<<t->get_in()<<" - "<<t->get("mlt_service");
}
}
bool TimelineModel::resizeStartMix(int cid, int duration, bool singleResize)
......
......@@ -370,7 +370,7 @@ public:
@param updateView if set to false, no signal is sent to qml
@param logUndo if set to false, no undo object is stored
*/
Q_INVOKABLE bool requestClipMove(int clipId, int trackId, int position, bool moveMirrorTracks = true, bool updateView = true, bool logUndo = true, bool invalidateTimeline = false);
Q_INVOKABLE bool requestClipMove(int clipId, int trackId, int position, bool moveMirrorTracks = true, bool updateView = true, bool logUndo = true, bool invalidateTimeline = false, bool revertMove = false);
Q_INVOKABLE bool requestSubtitleMove(int clipId, int position, bool updateView = true, bool logUndo = true, bool invalidateTimeline = false);
bool requestSubtitleMove(int clipId, int position, bool updateView, bool first, bool last, bool invalidateTimeline, Fun &undo, Fun &redo);
bool cutSubtitle(int position, Fun &undo, Fun &redo);
......@@ -386,7 +386,7 @@ public:
/* Same function, but accumulates undo and redo, and doesn't check
for group*/
bool requestClipMove(int clipId, int trackId, int position, bool moveMirrorTracks, bool updateView, bool invalidateTimeline, bool finalMove, Fun &undo, Fun &redo, bool groupMove = false, QMap <int, int> moving_clips = QMap <int, int>(), std::pair<MixInfo, MixInfo>mixData = {});
bool requestClipMove(int clipId, int trackId, int position, bool moveMirrorTracks, bool updateView, bool invalidateTimeline, bool finalMove, Fun &undo, Fun &redo, bool revertMove = false, bool groupMove = false, QMap <int, int> moving_clips = QMap <int, int>(), std::pair<MixInfo, MixInfo>mixData = {});
bool requestCompositionMove(int transid, int trackId, int compositionTrack, int position, bool updateView, bool finalMove, Fun &undo, Fun &redo);
/** @brief When timeline edit mode is insert or overwrite, we fake the move (as it will overlap existing clips, and only process the real move on drop */
......@@ -480,8 +480,8 @@ public:
@param logUndo if set to true, an undo object is created
@param allowViewRefresh if false, the view will never get updated (useful for suggestMove)
*/
bool requestGroupMove(int itemId, int groupId, int delta_track, int delta_pos, bool moveMirrorTracks = true, bool updateView = true, bool logUndo = true);
bool requestGroupMove(int itemId, int groupId, int delta_track, int delta_pos, bool updateView, bool finalMove, Fun &undo, Fun &redo, bool moveMirrorTracks = true,
bool requestGroupMove(int itemId, int groupId, int delta_track, int delta_pos, bool moveMirrorTracks = true, bool updateView = true, bool logUndo = true, bool revertMove = false);
bool requestGroupMove(int itemId, int groupId, int delta_track, int delta_pos, bool updateView, bool finalMove, Fun &undo, Fun &redo, bool revertMove = false, bool moveMirrorTracks = true,
bool allowViewRefresh = true, QVector<int> allowedTracks = QVector<int>());
/** @brief Deletes all clips inside the group that contains the given clip.
......
......@@ -507,7 +507,7 @@ int TrackModel::suggestCompositionLength(int position)
int track = clip_loc.first;
int index = clip_loc.second;
int other_index; // index in the other track
int other_track = (track + 1) % 2;
int other_track = 1 - track;
int end_pos = m_playlists[track].clip_start(index) + m_playlists[track].clip_length(index);
other_index = m_playlists[other_track].get_clip_index_at(end_pos);
if (other_index < m_playlists[other_track].count()) {
......@@ -562,7 +562,7 @@ int TrackModel::getBlankSizeNearClip(int clipId, bool after)
int track = clip_loc.first;
int index = clip_loc.second;
int other_index; // index in the other track
int other_track = (track + 1) % 2;
int other_track = 1 - track;
if (after) {
int first_pos = m_playlists[track].clip_start(index) + m_playlists[track].clip_length(index);
other_index = m_playlists[other_track].get_clip_index_at(first_pos);
......@@ -579,12 +579,16 @@ int TrackModel::getBlankSizeNearClip(int clipId, bool after)
return 0;
}
length = std::min(length, m_playlists[track].clip_length(index));
} else if (!after) {
length = std::min(length, m_playlists[track].clip_start(clip_loc.second) - m_playlists[track].get_length());
}
if (other_index < m_playlists[other_track].count()) {
if (!m_playlists[other_track].is_blank(other_index)) {
return 0;
}
length = std::min(length, m_playlists[other_track].clip_length(other_index));
} else if (!after) {
length = std::min(length, m_playlists[track].clip_start(clip_loc.second) - m_playlists[other_track].get_length());
}
return length;
}
......@@ -1538,10 +1542,10 @@ bool TrackModel::isAvailable(int position, int duration, int playlist)
{
if (playlist == -1) {
// Check on both playlists
for (auto &m_playlist : m_playlists) {
int start_clip = m_playlist.get_clip_index_at(position);
int end_clip = m_playlist.get_clip_index_at(position + duration - 1);
if (start_clip != end_clip || !m_playlist.is_blank(start_clip)) {
for (auto &playlist : m_playlists) {
int start_clip = playlist.get_clip_index_at(position);
int end_clip = playlist.get_clip_index_at(position + duration - 1);
if (start_clip != end_clip || !playlist.is_blank(start_clip)) {
return false;
}
}
......@@ -2299,6 +2303,11 @@ bool TrackModel::loadMix(Mlt::Transition *t)
int cid1 = getClipByPosition(in, reverse ? 1 : 0);
int cid2 = getClipByPosition(out, reverse ? 0 : 1);
if (cid1 < 0 || cid2 < 0) {
qDebug()<<"INVALID CLIP MIX: "<<cid1<<" - "<<cid2;
QScopedPointer<Mlt::Field> field(m_track->field());
field->lock();
field->disconnect_service(*t);
field->unlock();
return false;
}
QString assetId(t->get("kdenlive_id"));
......@@ -2413,3 +2422,16 @@ QVariantList TrackModel::stackZones() const
{
return m_effectStack->getEffectZones();
}
bool TrackModel::hasClipStart(int pos)
{
for (auto &m_playlist : m_playlists) {
if (m_playlist.is_blank_at(pos)) {
continue;
}
if (m_playlist.get_clip_index_at(pos) != m_playlist.get_clip_index_at(pos - 1)) {
return true;
}
}
return false;
}
......@@ -152,6 +152,8 @@ public:
const std::shared_ptr<AssetParameterModel> mixModel(int cid);
/** @brief Get a list of current effect stack zones */
QVariantList stackZones() const;
/** @brief Return true if a clip starts at pos in one of the trak playlists */
bool hasClipStart(int pos);
protected:
/** @brief This will lock the track: it will no longer allow insertion/deletion/resize of items
......
......@@ -1687,7 +1687,7 @@ Rectangle {
controller.requestCompositionMove(dragProxy.draggedItem, tId, dragFrame , true, true, true)
} else {
if (controller.normalEdit()) {
controller.requestClipMove(dragProxy.draggedItem, dragProxy.sourceTrack, dragProxy.sourceFrame, moveMirrorTracks, true, false, false)
controller.requestClipMove(dragProxy.draggedItem, dragProxy.sourceTrack, dragProxy.sourceFrame, moveMirrorTracks, true, false, false, true)
controller.requestClipMove(dragProxy.draggedItem, tId, dragFrame , moveMirrorTracks, true, true, true)
} else {
// Fake move, only process final move
......
......@@ -139,9 +139,14 @@ TEST_CASE("Simple Mix", "[SameTrackMix]")
state0();
REQUIRE(timeline->mixClip(cid4));
state2();
// Move clip inside mix zone, should resize the mix
REQUIRE(timeline->requestClipMove(cid4, tid2, 506));
REQUIRE(timeline->getTrackById_const(tid2)->mixCount() == 1);
// Move right clip to the left, should fail
REQUIRE(timeline->requestClipMove(cid4, tid2, 506) == false);
// Move clip inside mix zone, should delete the mix
REQUIRE(timeline->requestClipMove(cid4, tid2, 509));
REQUIRE(timeline->getTrackById_const(tid2)->mixCount() == 0);
REQUIRE(timeline->m_allClips[cid4]->getSubPlaylistIndex() == 0);
undoStack->undo();
state2();
// Move clip outside mix zone, should delete the mix and move it back to playlist 0
......@@ -166,14 +171,21 @@ TEST_CASE("Simple Mix", "[SameTrackMix]")
state0();
REQUIRE(timeline->mixClip(cid4));
state2();
// Move clip inside mix zone, should resize the mix
REQUIRE(timeline->requestClipMove(cid3, tid2, 502));
REQUIRE(timeline->getTrackById_const(tid2)->mixCount() == 1);
// Move left clip to the right, should silently fail
REQUIRE(timeline->requestClipMove(cid3, tid2, 502, true, true, false) == false);
REQUIRE(timeline->getClipPosition(cid3) == 500);
// Move clip inside mix zone, should delete the mix
REQUIRE(timeline->requestClipMove(cid3, tid2, 499));
REQUIRE(timeline->getTrackById_const(tid2)->mixCount() == 0);
REQUIRE(timeline->m_allClips[cid4]->getSubPlaylistIndex() == 0);
undoStack->undo();
state2();
// Move clip outside mix zone, should delete the mix
REQUIRE(timeline->requestClipMove(cid3, tid2, 450));
REQUIRE(timeline->getTrackById_const(tid2)->mixCount() == 0);
REQUIRE(timeline->m_allClips[cid4]->getSubPlaylistIndex() == 0);
undoStack->undo();
state2();
// Move clip to another track, should delete mix
......@@ -245,9 +257,9 @@ TEST_CASE("Simple Mix", "[SameTrackMix]")
REQUIRE(timeline->mixClip(cid2));
//state1();
// Move clip inside mix zone, should resize the mix
REQUIRE(timeline->requestClipMove(cid2, tid2, 101));
REQUIRE(timeline->getTrackById_const(tid3)->mixCount() == 1);
REQUIRE(timeline->getTrackById_const(tid2)->mixCount() == 1);
REQUIRE(timeline->requestClipMove(cid2, tid2, 105));
REQUIRE(timeline->getTrackById_const(tid3)->mixCount() == 0);
REQUIRE(timeline->getTrackById_const(tid2)->mixCount() == 0);
undoStack->undo();
state1();
// Move clip outside mix zone, should delete the mix
......
......@@ -2057,3 +2057,4 @@ TEST_CASE("Operations under locked tracks", "[Locked]")
binModel->clean();
pCore->m_projectManager = nullptr;
}
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