removed some effects boilerplate code
This commit is contained in:
@@ -12,10 +12,7 @@ AudioNoiseEffect::AudioNoiseEffect(Clip* c, const EffectMeta *em) : Effect(c, em
|
||||
mix_val = add_row("Mix:")->add_field(EFFECT_FIELD_BOOL, "mix");
|
||||
mix_val->set_bool_value(true);
|
||||
|
||||
srand(QDateTime::currentMSecsSinceEpoch());
|
||||
|
||||
connect(amount_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(mix_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
srand(QDateTime::currentMSecsSinceEpoch());
|
||||
}
|
||||
|
||||
void AudioNoiseEffect::process_audio(double timecode_start, double timecode_end, quint8 *samples, int nb_bytes, int) {
|
||||
|
||||
@@ -25,17 +25,7 @@ CornerPinEffect::CornerPinEffect(Clip *c, const EffectMeta *em) : Effect(c, em)
|
||||
bottom_right_y = bottom_right->add_field(EFFECT_FIELD_DOUBLE, "bottomrighty");
|
||||
|
||||
perspective = add_row("Perspective:")->add_field(EFFECT_FIELD_BOOL, "perspective");
|
||||
perspective->set_bool_value(true);
|
||||
|
||||
connect(top_left_x, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(top_left_y, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(top_right_x, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(top_right_y, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(bottom_left_x, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(bottom_left_y, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(bottom_right_x, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(bottom_right_y, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(perspective, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
perspective->set_bool_value(true);
|
||||
|
||||
vertPath = "cornerpin.vert";
|
||||
fragPath = "cornerpin.frag";
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
CrossDissolveTransition::CrossDissolveTransition(Clip* c, Clip* s, const EffectMeta* em) : Transition(c, s, em) {
|
||||
enable_coords = true;
|
||||
|
||||
add_row("Smooth")->add_field(EFFECT_FIELD_BOOL, "smooth");
|
||||
}
|
||||
|
||||
void CrossDissolveTransition::process_coords(double progress, GLTextureCoords&, int data) {
|
||||
|
||||
@@ -15,9 +15,7 @@ PanEffect::PanEffect(Clip* c, const EffectMeta *em) : Effect(c, em) {
|
||||
pan_val->set_double_maximum_value(100);
|
||||
|
||||
// set defaults
|
||||
pan_val->set_double_default_value(0);
|
||||
|
||||
connect(pan_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
pan_val->set_double_default_value(0);
|
||||
}
|
||||
|
||||
void PanEffect::process_audio(double timecode_start, double timecode_end, quint8* samples, int nb_bytes, int) {
|
||||
|
||||
@@ -38,10 +38,6 @@ ShakeEffect::ShakeEffect(Clip *c, const EffectMeta *em) : Effect(c, em) {
|
||||
for (int i=0;i<RANDOM_VAL_SIZE;i++) {
|
||||
random_vals[i] = (double)rand()/RAND_MAX;
|
||||
}
|
||||
|
||||
connect(intensity_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(rotation_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(frequency_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
}
|
||||
|
||||
void ShakeEffect::process_coords(double timecode, GLTextureCoords& coords, int data) {
|
||||
|
||||
@@ -38,11 +38,6 @@ SolidEffect::SolidEffect(Clip* c, const EffectMeta* em) : Effect(c, em) {
|
||||
checkerboard_size_field->set_double_minimum_value(1);
|
||||
checkerboard_size_field->set_double_default_value(10);
|
||||
|
||||
connect(solid_type, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(solid_color_field, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(opacity_field, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(checkerboard_size_field, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
|
||||
// hacky but eh
|
||||
QComboBox* solid_type_combo = static_cast<QComboBox*>(solid_type->get_ui_element());
|
||||
connect(solid_type_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(ui_update(int)));
|
||||
|
||||
@@ -76,23 +76,7 @@ TextEffect::TextEffect(Clip *c, const EffectMeta* em) :
|
||||
outline_width->set_double_default_value(20);
|
||||
|
||||
outline_enable(false);
|
||||
shadow_enable(false);
|
||||
|
||||
connect(text_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(size_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(set_color_button, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(set_font_combobox, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(halign_field, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(valign_field, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(word_wrap_field, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(outline_bool, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(outline_color, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(outline_width, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(shadow_bool, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(shadow_color, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(shadow_distance, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(shadow_softness, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(shadow_opacity, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
shadow_enable(false);
|
||||
|
||||
connect(shadow_bool, SIGNAL(toggled(bool)), this, SLOT(shadow_enable(bool)));
|
||||
connect(outline_bool, SIGNAL(toggled(bool)), this, SLOT(outline_enable(bool)));
|
||||
|
||||
@@ -23,11 +23,7 @@ ToneEffect::ToneEffect(Clip* c, const EffectMeta *em) : Effect(c, em), sinX(INT_
|
||||
amount_val->set_double_default_value(25);
|
||||
|
||||
mix_val = add_row("Mix:")->add_field(EFFECT_FIELD_BOOL, "mix");
|
||||
mix_val->set_bool_value(true);
|
||||
|
||||
connect(freq_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(amount_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(mix_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
mix_val->set_bool_value(true);
|
||||
}
|
||||
|
||||
void ToneEffect::process_audio(double timecode_start, double timecode_end, quint8 *samples, int nb_bytes, int) {
|
||||
|
||||
@@ -65,16 +65,6 @@ TransformEffect::TransformEffect(Clip* c, const EffectMeta* em) : Effect(c, em)
|
||||
blend_mode_box->set_combo_index(0);
|
||||
refresh();
|
||||
|
||||
connect(position_x, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(position_y, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(scale_x, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(scale_y, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(uniform_scale_field, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(rotation, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(anchor_x_box, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(anchor_y_box, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(opacity, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(blend_mode_box, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(uniform_scale_field, SIGNAL(toggled(bool)), this, SLOT(toggle_uniform_scale(bool)));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,7 @@ VolumeEffect::VolumeEffect(Clip* c, const EffectMeta *em) : Effect(c, em) {
|
||||
volume_val->set_double_minimum_value(0);
|
||||
|
||||
// set defaults
|
||||
volume_val->set_double_default_value(100);
|
||||
|
||||
connect(volume_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
volume_val->set_double_default_value(100);
|
||||
}
|
||||
|
||||
void VolumeEffect::process_audio(double timecode_start, double timecode_end, quint8* samples, int nb_bytes, int) {
|
||||
|
||||
@@ -149,6 +149,7 @@ EffectField* EffectRow::add_field(int type, const QString& id, int colspan) {
|
||||
fields.append(field);
|
||||
QWidget* element = field->get_ui_element();
|
||||
ui->addWidget(element, ui_row, fields.size(), 1, colspan);
|
||||
connect(field, SIGNAL(changed()), parent_effect, SLOT(field_changed()));
|
||||
return field;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user