fix min speed value 0.005, fix canvas lock hang, fix reset_caches crashing on vicon...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / trackcanvas.C
index 7d2da1e210463fe55eeef9ddab4d33572cc48495..0e42ed89109de1d18108197e4d2877d4f711f46b 100644 (file)
@@ -2842,6 +2842,8 @@ void TrackCanvas::draw_floatline(int center_pixel,
        float automation_min = mwindow->edl->local_session->automation_mins[autogrouptype];
        float automation_max = mwindow->edl->local_session->automation_maxs[autogrouptype];
        float automation_range = automation_max - automation_min;
+       if( autogrouptype == AUTOGROUPTYPE_SPEED && automation_range < SPEED_MIN )
+               automation_range = SPEED_MIN;
        for( int x=x1; x<x2; ++x ) {
 // Interpolate value between frames
                X_TO_FLOATLINE(x)
@@ -2876,6 +2878,8 @@ int TrackCanvas::test_floatline(int center_pixel,
        float automation_min = mwindow->edl->local_session->automation_mins[autogrouptype];
        float automation_max = mwindow->edl->local_session->automation_maxs[autogrouptype];
        float automation_range = automation_max - automation_min;
+       if( autogrouptype == AUTOGROUPTYPE_SPEED && automation_range < SPEED_MIN )
+               automation_range = SPEED_MIN;
        FloatAuto *previous1 = 0, *next1 = 0;
        X_TO_FLOATLINE(cursor_x);
 
@@ -2938,7 +2942,7 @@ void TrackCanvas::fill_ganged_autos(int all, float change, Track *skip, FloatAut
                                CLAMP(new_value, auto_min, auto_max);
                                keyframe->adjust_to_new_coordinates(current_position, new_value);
                        }
-                       else {
+                       else if( all >= 0 ) {
 // create keyframe on neighbouring track at the point in time given by fauto
                                FloatAuto *previous = 0, *next = 0;
                                float value = fade_autos->get_value(current_position, PLAY_FORWARD, previous, next);
@@ -2947,6 +2951,7 @@ void TrackCanvas::fill_ganged_autos(int all, float change, Track *skip, FloatAut
                                keyframe = (FloatAuto*)fade_autos->insert_auto(current_position);
                                keyframe->set_value(new_value);
                        }
+                       if( !keyframe ) continue;
                        mwindow->session->drag_auto_gang->append((Auto *)keyframe);
                }
        }
@@ -3123,6 +3128,8 @@ void TrackCanvas::calculate_auto_position(double *x, double *y,
        float automation_min = mwindow->edl->local_session->automation_mins[autogrouptype];
        float automation_max = mwindow->edl->local_session->automation_maxs[autogrouptype];
        float automation_range = automation_max - automation_min;
+       if( autogrouptype == AUTOGROUPTYPE_SPEED && automation_range < SPEED_MIN )
+               automation_range = SPEED_MIN;
        FloatAuto *ptr = (FloatAuto*)current;
        *x = (double)(ptr->position - unit_start) / zoom_units;
        *y = ((ptr->get_value() - automation_min) / automation_range - 0.5) * -yscale;