timeline: copy waveform when copying

This commit is contained in:
itsmattkc
2021-08-25 12:27:26 -07:00
parent dc66c30357
commit 6bd7bc4cca
4 changed files with 22 additions and 3 deletions
@@ -605,6 +605,9 @@ void PointerTool::FinishDrag(TimelineViewMouseEvent *event)
// Duplicate rather than move
// Place the copy instead of the original block
block = static_cast<Block*>(Node::CopyNodeInGraph(block, command));
if (ClipBlock *new_clip = dynamic_cast<ClipBlock*>(block)) {
new_clip->waveform() = static_cast<ClipBlock*>(p.block)->waveform();
}
}
const Track::Reference& track_ref = p.ghost->GetAdjustedTrack();
@@ -20,6 +20,7 @@
#include "timelineundosplit.h"
#include "node/block/clip/clip.h"
#include "node/block/transition/transition.h"
#include "widget/nodeview/nodeviewundo.h"
@@ -37,6 +38,10 @@ void BlockSplitCommand::redo()
if (!reconnect_tree_command_) {
reconnect_tree_command_ = new MultiUndoCommand();
new_block_ = static_cast<Block*>(Node::CopyNodeInGraph(block_, reconnect_tree_command_));
if (ClipBlock *new_clip = dynamic_cast<ClipBlock*>(new_block_)) {
ClipBlock *old_clip = static_cast<ClipBlock*>(block_);
new_clip->waveform() = old_clip->waveform();
}
}
reconnect_tree_command_->redo_now();