X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fkeyframes.C;fp=cinelerra-5.1%2Fcinelerra%2Fkeyframes.C;h=9e90bd641d796fe43f76481d4a97753bb4a1a92b;hp=13e2fbc507464b3ef588b52be61dd0ed7e9b64b7;hb=270d86e71b318578d56d0e8a245cf14f32cf09ac;hpb=b598658d6fc36b38ebedf4e2ce62ca03782e6e11 diff --git a/cinelerra-5.1/cinelerra/keyframes.C b/cinelerra-5.1/cinelerra/keyframes.C index 13e2fbc5..9e90bd64 100644 --- a/cinelerra-5.1/cinelerra/keyframes.C +++ b/cinelerra-5.1/cinelerra/keyframes.C @@ -110,68 +110,34 @@ KeyFrame* KeyFrames::get_keyframe() void KeyFrames::update_parameter(KeyFrame *src) { - const int debug = 0; // Create new keyframe if auto keyframes or replace entire keyframe. double selection_start = edl->local_session->get_selectionstart(0); double selection_end = edl->local_session->get_selectionend(0); selection_start = edl->align_to_frame(selection_start, 0); selection_end = edl->align_to_frame(selection_end, 0); - if(EQUIV(selection_start, selection_end)) - { -// Search for keyframe to write to + if( EQUIV(selection_start, selection_end) ) { +// Search for keyframe to write KeyFrame *dst = get_keyframe(); - dst->copy_data(src); } - else + else { // Replace changed parameter in all selected keyframes. - { BC_Hash *params = 0; - char *text = 0; - char *extra = 0; - - + char *text = 0, *extra = 0; // Search all keyframes in selection but don't create a new one. int64_t start = track->to_units(selection_start, 0); int64_t end = track->to_units(selection_end, 0); - KeyFrame *current = get_prev_keyframe( - start, - PLAY_FORWARD); - + KeyFrame *current = get_prev_keyframe(start, PLAY_FORWARD); // The first one determines the changed parameters since it is the one displayed -// in the GUI. - current->get_diff(src, - ¶ms, - &text, - &extra); - - -if(debug) printf("KeyFrames::update_parameter %d params=%p position=%jd start=%jd\n", - __LINE__, params, current->position, track->to_units(start, 0)); - -if(debug && params) -{ -for(int i = 0; i < params->size(); i++) -printf("KeyFrames::update_parameter %d changed=%s %s\n", -__LINE__, -params->get_key(i), -params->get_value(i)); -} - + current->get_diff(src, ¶ms, &text, &extra); // Always update the first one - current->update_parameter(params, - text, - extra); - for(current = (KeyFrame*)NEXT ; current && current->position < end; current = (KeyFrame*)NEXT) - { -if(debug) printf("KeyFrames::update_parameter %d position=%jd\n", - __LINE__, current->position); - current->update_parameter(params, - text, - extra); - } + current->update_parameter(params, text, extra); + for( current = (KeyFrame*)NEXT; current; current = (KeyFrame*)NEXT ) { + if( current->position >= end ) break; + current->update_parameter(params, text, extra); + } delete params; delete [] text, delete [] extra;