X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ffloatauto.C;h=8e3e63682af1a56e43d3d474bb3f8076d9909041;hb=540f653df26e5e2d1249de1f7a1a3d888dddf341;hp=1f22aeaa1c851661d30f9af759d13ed38d50d8a0;hpb=21c2e6b36d6a96c2f662a89459d607b5a387f4eb;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/floatauto.C b/cinelerra-5.1/cinelerra/floatauto.C index 1f22aeaa..8e3e6368 100644 --- a/cinelerra-5.1/cinelerra/floatauto.C +++ b/cinelerra-5.1/cinelerra/floatauto.C @@ -74,6 +74,18 @@ int FloatAuto::identical(FloatAuto *src) // curve_mode is ignored, no recalculations } +// exactly equals +int FloatAuto::equals(FloatAuto *that) +{ + return this->value == that->value && + this->control_in_value == that->control_in_value && + this->control_out_value == that->control_out_value && + this->control_in_position == that->control_in_position && + this->control_out_position == that->control_out_position && + this->curve_mode == that->curve_mode; +} + + /* Note: the following is essentially display-code and has been moved to: * TrackCanvas::value_to_percentage(float auto_value, int autogrouptype) * @@ -142,9 +154,11 @@ int FloatAuto::interpolate_from(Auto *a1, Auto *a2, int64_t pos, Auto *templ) // set this->value using bézier interpolation if possible FloatAuto *left = (FloatAuto*)a1; FloatAuto *right = (FloatAuto*)a2; - float new_value = FloatAutos::calculate_bezier(left, right, pos); + if( pos != position ) { // this may trigger smoothing + this->adjust_to_new_coordinates(pos, + FloatAutos::calculate_bezier(left, right, pos)); + } float new_slope = FloatAutos::calculate_bezier_derivation(left, right, pos); - this->adjust_to_new_coordinates(pos, new_value); // this may trigger smoothing this->set_control_in_value(new_slope * control_in_position); this->set_control_out_value(new_slope * control_out_position); return 1; //return true: interpolated indeed...