X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpluginserver.C;h=18619cc7ad98ff2d88c7f16eabb5df4128de393a;hb=84b52741889e1afee840d7c24009cc139244ce74;hp=f10cec05742a4a1ceb679d3da7b96c183a65388a;hpb=1529091cdf16df199a901aabe6e8fa1813a933af;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/pluginserver.C b/cinelerra-5.1/cinelerra/pluginserver.C index f10cec05..18619cc7 100644 --- a/cinelerra-5.1/cinelerra/pluginserver.C +++ b/cinelerra-5.1/cinelerra/pluginserver.C @@ -1174,16 +1174,28 @@ KeyFrame* PluginServer::get_keyframe() } -void PluginServer::apply_keyframe(KeyFrame *src) -{ - Plugin *plugin = edl->tracks->plugin_exists(plugin_id); - if( !plugin ) - keyframe->copy_data(src); - else if( plugin->is_transition() ) - plugin->get_keyframe()->copy_data(src); - else -// Span keyframes - plugin->keyframes->update_parameter(src); +void PluginServer::apply_keyframe(Plugin *plugin, KeyFrame *src) +{ + KeyFrame* dst = !plugin ? keyframe : + plugin->is_transition() ? plugin->get_keyframe() : 0; + if( !dst ) { + if( edl->session->span_keyframes ) { + 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); + Track *track = plugin->track; + int64_t start = track->to_units(selection_start, 1); + int64_t end = track->to_units(selection_end, 1); + if( start != end ) { + client->span_keyframes(src, start, end); + return; + } + } + dst = get_keyframe(); + } + if( dst ) + dst->copy_data(src); }