speeddurationdialog: implemented rippling trailing clips

This commit is contained in:
itsmattkc
2022-05-10 16:08:51 -07:00
parent 182e1599af
commit 790a483e1b
3 changed files with 12 additions and 11 deletions
@@ -145,17 +145,11 @@ SpeedDurationDialog::SpeedDurationDialog(const QVector<ClipBlock *> &clips, cons
void SpeedDurationDialog::accept()
{
// We haven't implemented rippling yet, so warn the user
if (ripple_box_->isChecked()) {
// FIXME: Stub
if (QMessageBox::information(this, QString(), tr("Rippling is a stub and will not do anything. Do you wish to continue?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) {
return;
}
}
MultiUndoCommand *command = new MultiUndoCommand();
// Set duration values
TimelineRippleDeleteGapsAtRegionsCommand::RangeList ripple_ranges;
foreach (ClipBlock *c, clips_) {
rational proposed_length = c->length();
@@ -179,10 +173,15 @@ void SpeedDurationDialog::accept()
if (proposed_length != c->length()) {
command->add_child(new BlockTrimCommand(c->track(), c, proposed_length, Timeline::kTrimOut));
ripple_ranges.append({c->track(), TimeRange(c->in() + proposed_length, c->out())});
}
}
}
if (ripple_box_->isChecked()) {
command->add_child(new TimelineRippleDeleteGapsAtRegionsCommand(clips_.first()->track()->sequence(), ripple_ranges));
}
// Set speed values
if (speed_slider_->IsTristate()) {
if (link_box_->isChecked() && !dur_slider_->IsTristate()) {