reimplemented edit to point functions
This commit is contained in:
@@ -435,11 +435,21 @@ void TimelineView::RippleEditTo(olive::timeline::MovementMode mode, bool insert_
|
||||
}
|
||||
}
|
||||
|
||||
rational in_ripple = qMin(closest_point_to_playhead, playhead_time);
|
||||
rational out_ripple = qMax(closest_point_to_playhead, playhead_time);
|
||||
rational ripple_length = out_ripple - in_ripple;
|
||||
|
||||
foreach (TrackOutput* track, timeline_node_->Tracks()) {
|
||||
new TrackRippleRemoveAreaCommand(track,
|
||||
qMin(closest_point_to_playhead, playhead_time),
|
||||
qMax(closest_point_to_playhead, playhead_time),
|
||||
command);
|
||||
TrackRippleRemoveAreaCommand* ripple_command = new TrackRippleRemoveAreaCommand(track,
|
||||
in_ripple,
|
||||
out_ripple,
|
||||
command);
|
||||
|
||||
if (insert_gaps) {
|
||||
GapBlock* gap = new GapBlock();
|
||||
gap->set_length(ripple_length);
|
||||
ripple_command->SetInsert(gap);
|
||||
}
|
||||
}
|
||||
|
||||
olive::undo_stack.pushIfHasChildren(command);
|
||||
|
||||
@@ -146,6 +146,11 @@ TrackRippleRemoveAreaCommand::TrackRippleRemoveAreaCommand(TrackOutput *track, r
|
||||
{
|
||||
}
|
||||
|
||||
void TrackRippleRemoveAreaCommand::SetInsert(Block *insert)
|
||||
{
|
||||
insert_ = insert;
|
||||
}
|
||||
|
||||
void TrackRippleRemoveAreaCommand::redo()
|
||||
{
|
||||
// Iterate through blocks determining which need trimming/removing/splitting
|
||||
|
||||
@@ -122,6 +122,8 @@ class TrackRippleRemoveAreaCommand : public QUndoCommand {
|
||||
public:
|
||||
TrackRippleRemoveAreaCommand(TrackOutput* track, rational in, rational out, QUndoCommand* parent = nullptr);
|
||||
|
||||
void SetInsert(Block* insert);
|
||||
|
||||
virtual void redo() override;
|
||||
virtual void undo() override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user