many fixes and ripple edit corrections

This commit is contained in:
itsmattkc
2018-07-22 17:59:03 +01:00
parent ce4d7fda60
commit 6109ed9002
22 changed files with 400 additions and 181 deletions
+2 -2
View File
@@ -75,8 +75,8 @@ public:
LabelSlider* intensity_val;
LabelSlider* rotation_val;
LabelSlider* frequency_val;
private slots:
void set_values();
public slots:
void init();
private:
int shake_progress;
int shake_limit;
+9 -7
View File
@@ -33,7 +33,7 @@ ShakeEffect::ShakeEffect(Clip *c) : Effect(c, EFFECT_TYPE_VIDEO, VIDEO_SHAKE_EFF
rotation_val->set_value(0);
frequency_val->set_value(10);
set_values();
init();
connect(intensity_val, SIGNAL(valueChanged()), this, SLOT(field_changed()));
connect(rotation_val, SIGNAL(valueChanged()), this, SLOT(field_changed()));
@@ -43,12 +43,14 @@ ShakeEffect::ShakeEffect(Clip *c) : Effect(c, EFFECT_TYPE_VIDEO, VIDEO_SHAKE_EFF
connect(frequency_val, SIGNAL(valueChanged()), this, SLOT(set_values()));
}
void ShakeEffect::set_values() {
shake_limit = qRound(parent_clip->sequence->frame_rate / frequency_val->value());
shake_progress = shake_limit;
next_x = 0;
next_y = 0;
next_rot = 0;
void ShakeEffect::init() {
if (parent_clip->sequence != NULL) {
shake_limit = qRound(parent_clip->sequence->frame_rate / frequency_val->value());
shake_progress = shake_limit;
next_x = 0;
next_y = 0;
next_rot = 0;
}
}
Effect* ShakeEffect::copy(Clip* c) {
+4 -3
View File
@@ -85,15 +85,16 @@ TransformEffect::TransformEffect(Clip* c) : Effect(c, EFFECT_TYPE_VIDEO, VIDEO_T
}
void TransformEffect::init() {
if (parent_clip->media_stream != NULL) {
MediaStream* ms = parent_clip->media->get_stream_from_file_index(parent_clip->media_stream);
if (ms != NULL && parent_clip->sequence != NULL) {
position_x->set_default_value(parent_clip->sequence->width/2);
position_y->set_default_value(parent_clip->sequence->height/2);
scale_x->set_default_value(100);
scale_y->set_default_value(100);
scale_y->setEnabled(false);
uniform_scale_box->setChecked(true);
default_anchor_x = parent_clip->media_stream->video_width/2;
default_anchor_y = parent_clip->media_stream->video_height/2;
default_anchor_x = ms->video_width/2;
default_anchor_y = ms->video_height/2;
anchor_x_box->set_default_value(default_anchor_x);
anchor_y_box->set_default_value(default_anchor_y);
opacity->set_default_value(100);