X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fautos.C;h=73e89a917ceb448f5510379ecea05f6a63e74987;hp=ced078364c5578980abe367c9324b39109f1adf9;hb=f7444a58936e4ab8fa7e7062281567cbc74e175f;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1 diff --git a/cinelerra-5.1/cinelerra/autos.C b/cinelerra-5.1/cinelerra/autos.C index ced07836..73e89a91 100644 --- a/cinelerra-5.1/cinelerra/autos.C +++ b/cinelerra-5.1/cinelerra/autos.C @@ -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