sams last ladspa icons, libopus/vp9, mixer fixer, plugin resets, fmt frmsz, shm fixes
[goodguy/history.git] / cinelerra-5.1 / cinelerra / floatautos.C
index fde4a155eca44c0e571658541c714d295796bd58..04741afe145fabd6fdefc63b31daab1c641f7bb4 100644 (file)
@@ -409,6 +409,22 @@ void FloatAutos::get_extents(float *min,
        }
 }
 
+void FloatAutos::set_proxy(int orig_scale, int new_scale)
+{
+       float orig_value;
+       orig_value = ((FloatAuto*)default_auto)->value * orig_scale;
+       ((FloatAuto*)default_auto)->value = orig_value / new_scale;
+
+       for( FloatAuto *current= (FloatAuto*)first; current; current=(FloatAuto*)NEXT ) {
+               orig_value = current->value * orig_scale;
+               current->value = orig_value / new_scale;
+               orig_value = current->control_in_value * orig_scale;
+               current->control_in_value = orig_value / new_scale;
+               orig_value = current->control_out_value * orig_scale;
+               current->control_out_value = orig_value / new_scale;
+       }
+}
+
 void FloatAutos::dump()
 {
        printf("        FloatAutos::dump %p\n", this);
@@ -439,10 +455,10 @@ double FloatAutos::automation_integral(int64_t start, int64_t length, int direct
        if( end > len ) end = len;
        while( pos < end ) {
                int64_t prev_pos = 0, next_pos = len;
-               FloatAuto *prev = 0, *next = 0;
-               prev = (FloatAuto*)get_prev_auto(pos, direction, (Auto* &)prev, 0);
+               Auto *zprev = 0, *znext = 0;
+               FloatAuto *prev = (FloatAuto*)get_prev_auto(pos, direction, zprev, 0);
                if( prev ) prev_pos = prev->position;
-               next = (FloatAuto*)get_next_auto(pos, direction, (Auto* &)next, 0);
+               FloatAuto *next = (FloatAuto*)get_next_auto(pos, direction, znext, 0);
                if( next ) next_pos = next->position;
                if( !prev && !next ) prev = next = (FloatAuto*)default_auto;
                else if( !prev ) prev = next;