several improvements
This commit is contained in:
@@ -90,6 +90,10 @@ void NewSequenceDialog::on_buttonBox_accepted() {
|
||||
panel_project->new_sequence(ca, s, true, NULL);
|
||||
undo_stack.push(ca);
|
||||
} else {
|
||||
ComboAction* ca = new ComboAction();
|
||||
|
||||
double multiplier = ui->frame_rate_combobox->currentData().toDouble() / existing_sequence->frame_rate;
|
||||
|
||||
EditSequenceCommand* esc = new EditSequenceCommand(existing_item, existing_sequence);
|
||||
esc->name = ui->lineEdit->text();
|
||||
esc->width = ui->width_numeric->value();
|
||||
@@ -97,7 +101,16 @@ void NewSequenceDialog::on_buttonBox_accepted() {
|
||||
esc->frame_rate = ui->frame_rate_combobox->currentData().toDouble();
|
||||
esc->audio_frequency = ui->audio_frequency_combobox->currentData().toInt();
|
||||
esc->audio_layout = AV_CH_LAYOUT_STEREO;
|
||||
undo_stack.push(esc);
|
||||
ca->append(esc);
|
||||
|
||||
for (int i=0;i<existing_sequence->clips.size();i++) {
|
||||
Clip* c = existing_sequence->clips.at(i);
|
||||
if (c != NULL) {
|
||||
c->refactor_frame_rate(ca, multiplier, true);
|
||||
}
|
||||
}
|
||||
|
||||
undo_stack.push(ca);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-15
@@ -315,21 +315,8 @@ void set_speed(ComboAction* ca, Clip* c, double speed, bool ripple, long& ep, lo
|
||||
ep = qMin(ep, c->timeline_out);
|
||||
lr = qMax(lr, proposed_out - c->timeline_out);
|
||||
ca->append(new MoveClipAction(c, c->timeline_in, proposed_out, c->clip_in * multiplier, c->track));
|
||||
for (int i=0;i<c->effects.size();i++) {
|
||||
Effect* e = c->effects.at(i);
|
||||
for (int j=0;j<e->row_count();j++) {
|
||||
EffectRow* r = e->row(j);
|
||||
for (int k=0;k<r->keyframe_times.size();k++) {
|
||||
long new_pos = r->keyframe_times.at(k) * c->speed / speed;
|
||||
qDebug() << "old key" << r->keyframe_times.at(k) << "new key" << new_pos;
|
||||
KeyframeMove* km = new KeyframeMove();
|
||||
km->movement = new_pos - r->keyframe_times.at(k);
|
||||
km->rows.append(r);
|
||||
km->keyframes.append(k);
|
||||
ca->append(km);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
c->refactor_frame_rate(ca, multiplier, false);
|
||||
|
||||
Selection sel;
|
||||
sel.in = c->timeline_in;
|
||||
|
||||
Reference in New Issue
Block a user