add mask color radio btn sel, fix del all mask btn, fix mask dflt kfrm draw name...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / autos.C
index ced078364c5578980abe367c9324b39109f1adf9..73e89a917ceb448f5510379ecea05f6a63e74987 100644 (file)
@@ -280,7 +280,7 @@ Auto* Autos::get_auto_at_position(double position)
 }
 
 
-Auto* Autos::get_auto_for_editing(double position)
+Auto* Autos::get_auto_for_editing(double position, int create)
 {
        if(position < 0) {
                position = edl->local_session->get_selectionstart(1);
@@ -288,7 +288,8 @@ Auto* Autos::get_auto_for_editing(double position)
 
        Auto *result = 0;
        get_prev_auto(track->to_units(position, 0), PLAY_FORWARD, result);
-       if( edl->session->auto_keyframes && (!result || result->is_default ||
+       if( create > 0 ) create = edl->session->auto_keyframes;
+       if( create && (!result || result->is_default ||
               !EQUIV(track->from_units(result->position), position)) ) {
 //printf("Autos::get_auto_for_editing %p %p %p\n", default_auto, first, result);
                position = edl->align_to_frame(position, 0);
@@ -396,17 +397,11 @@ Auto* Autos::insert_auto(int64_t position, Auto *templ)
        return result;
 }
 
-int Autos::clear_all()
+void Autos::clear_all()
 {
-       Auto *current_, *current;
-
-       for(current = first; current; current = current_)
-       {
-               current_ = NEXT;
-               remove(current);
-       }
-       append_auto();
-       return 0;
+       while( last ) delete last;
+       delete default_auto;
+       create_objects();
 }
 
 int Autos::insert(int64_t start, int64_t end)
@@ -503,9 +498,6 @@ int Autos::copy(int64_t start,
        if(active_only || (!default_only && !active_only))
        {
                Auto *current = autoof(start);
-// need the last one if past the end
-               if( !current && last )
-                       last->copy(start, end, file, default_only);
 
                while( current && current->position <= end ) {
 // Want to copy single keyframes by putting the cursor on them