Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clip move duplicated regression #1335

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/commands/timelinecommands.cpp
Expand Up @@ -451,7 +451,7 @@ void MoveClipCommand::redo()
{
LOG_DEBUG() << "track delta" << m_trackDelta;
int trackIndex, clipIndex;
QMultiMap<int, Mlt::Producer> newSelection;
QList<Mlt::Producer> newSelection;

if (!m_redo) {
if (m_selection.size() > 1)
Expand Down Expand Up @@ -506,7 +506,7 @@ void MoveClipCommand::redo()
m_clipIndexList << clipIndex;
m_inList << info->frame_in;
m_outList << info->frame_out;
newSelection.insert(info->cut->get_int(kPlaylistStartProperty), info->producer);
newSelection << info->producer;
if (m_markerOldStart < 0 || m_markerOldStart > info->start) {
// Record the left most clip position being moved
m_markerOldStart = info->start;
Expand Down
4 changes: 2 additions & 2 deletions src/commands/timelinecommands.h
Expand Up @@ -211,7 +211,7 @@ class MoveClipCommand : public QUndoCommand
QUndoCommand *parent = 0);
void redo();
void undo();
QMultiMap<int, Mlt::Producer> &selection()
QList<Mlt::Producer> &selection()
{
return m_selection;
}
Expand All @@ -225,7 +225,7 @@ class MoveClipCommand : public QUndoCommand
bool m_rippleAllTracks;
bool m_rippleMarkers;
UndoHelper m_undoHelper;
QMultiMap<int, Mlt::Producer> m_selection; // ordered by position
QList<Mlt::Producer> m_selection; // ordered by whatever order the user has selected clips
QList<int> m_newTrackIndexList;
QList<int> m_playlistStartList;
QList<int> m_trackIndexList;
Expand Down
4 changes: 2 additions & 2 deletions src/docks/timelinedock.cpp
Expand Up @@ -1645,7 +1645,7 @@ void TimelineDock::onProducerChanged(Mlt::Producer *after)
new Timeline::LiftCommand(m_model, trackIndex, clipIndex));
auto moveCommand = new Timeline::MoveClipCommand(m_model, m_markersModel, 0, true);
nextInfo->cut->set(kPlaylistStartProperty, position);
moveCommand->selection().insert(nextInfo->start, *nextInfo->cut);
moveCommand->selection() << *nextInfo->cut;
MAIN.undoStack()->push(moveCommand);
MAIN.undoStack()->push(
new Timeline::OverwriteCommand(m_model, trackIndex, info->start, MLT.XML(after), false));
Expand Down Expand Up @@ -2463,7 +2463,7 @@ void TimelineDock::onClipMoved(int fromTrack, int toTrack, int clipIndex, int po
LOG_DEBUG() << "moving clip at" << clip << "start" << info->start << "+" << position << "=" <<
info->start + position;
info->cut->set(kPlaylistStartProperty, info->start + position);
command->selection().insert(info->start, *info->cut);
command->selection() << *info->cut;
}
}
setSelection();
Expand Down