added #138
This commit is contained in:
+16
-3
@@ -16,6 +16,7 @@
|
||||
#include "panels/panels.h"
|
||||
#include "panels/timeline.h"
|
||||
#include "project/undo.h"
|
||||
#include "effects/effect.h"
|
||||
|
||||
SpeedDialog::SpeedDialog(QWidget *parent) : QDialog(parent) {
|
||||
QVBoxLayout* main_layout = new QVBoxLayout();
|
||||
@@ -147,8 +148,6 @@ void SpeedDialog::run() {
|
||||
current_percent = qSNaN();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
frame_rate->set_minimum_value(1);
|
||||
@@ -313,7 +312,21 @@ 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));
|
||||
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) / speed;
|
||||
KeyframeMove* km = new KeyframeMove();
|
||||
km->movement = new_pos - r->keyframe_times.at(k);
|
||||
km->rows.append(r);
|
||||
km->keyframes.append(k);
|
||||
ca->append(km);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SpeedDialog::accept() {
|
||||
|
||||
+11
-10
@@ -459,16 +459,7 @@ EffectRow::EffectRow(Effect *parent, QGridLayout *uilayout, const QString &n, in
|
||||
QHBoxLayout* key_controls = new QHBoxLayout();
|
||||
key_controls->setSpacing(0);
|
||||
key_controls->setMargin(0);
|
||||
|
||||
keyframe_enable = new QPushButton(QIcon(":/icons/clock.png"), "");
|
||||
keyframe_enable->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
|
||||
keyframe_enable->setMaximumSize(button_size);
|
||||
keyframe_enable->setIconSize(icon_size);
|
||||
keyframe_enable->setCheckable(true);
|
||||
keyframe_enable->setToolTip("Enable Keyframes");
|
||||
connect(keyframe_enable, SIGNAL(clicked(bool)), this, SLOT(set_keyframe_enabled(bool)));
|
||||
connect(keyframe_enable, SIGNAL(toggled(bool)), this, SLOT(keyframe_ui_enabled(bool)));
|
||||
key_controls->addWidget(keyframe_enable);
|
||||
key_controls->addStretch();
|
||||
|
||||
left_key_nav = new QPushButton("<");
|
||||
left_key_nav->setVisible(false);
|
||||
@@ -488,6 +479,16 @@ EffectRow::EffectRow(Effect *parent, QGridLayout *uilayout, const QString &n, in
|
||||
key_controls->addWidget(right_key_nav);
|
||||
connect(right_key_nav, SIGNAL(clicked(bool)), this, SLOT(goto_next_key()));
|
||||
|
||||
keyframe_enable = new QPushButton(QIcon(":/icons/clock.png"), "");
|
||||
keyframe_enable->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
|
||||
keyframe_enable->setMaximumSize(button_size);
|
||||
keyframe_enable->setIconSize(icon_size);
|
||||
keyframe_enable->setCheckable(true);
|
||||
keyframe_enable->setToolTip("Enable Keyframes");
|
||||
connect(keyframe_enable, SIGNAL(clicked(bool)), this, SLOT(set_keyframe_enabled(bool)));
|
||||
connect(keyframe_enable, SIGNAL(toggled(bool)), this, SLOT(keyframe_ui_enabled(bool)));
|
||||
key_controls->addWidget(keyframe_enable);
|
||||
|
||||
ui->addLayout(key_controls, row, 6);
|
||||
}
|
||||
|
||||
|
||||
@@ -433,8 +433,6 @@ void reset_cache(Clip* c, long target_frame) {
|
||||
int64_t seek_ts = qRound(clip_frame_to_seconds(c, target_frame) / timebase);
|
||||
av_seek_frame(c->formatCtx, ms->file_index, seek_ts - (av_q2d(av_inv_q(c->stream->time_base))), AVSEEK_FLAG_BACKWARD);
|
||||
|
||||
qDebug() << "seek ts:" << seek_ts;
|
||||
|
||||
// play up to the frame we actually want
|
||||
int ret;
|
||||
do {
|
||||
@@ -443,7 +441,6 @@ void reset_cache(Clip* c, long target_frame) {
|
||||
qDebug() << "[WARNING] Seeking terminated prematurely";
|
||||
break;
|
||||
}
|
||||
qDebug() << "received ts:" << temp->pts;
|
||||
} while (temp->pts + temp->pkt_duration + temp->pkt_duration < seek_ts);
|
||||
av_frame_unref(temp);
|
||||
av_frame_free(&temp);
|
||||
|
||||
Reference in New Issue
Block a user