X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpluginserver.C;h=dec5824c97886da41ac77d05090ddef52ff60156;hb=166867a58d74619aa11aeb562a994cc364d62231;hp=a12eaac6245667ea02b45352ecb1f30f75a6176b;hpb=9782ed720c4e992ed0427de68c6646720c9b44e4;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/pluginserver.C b/cinelerra-5.1/cinelerra/pluginserver.C index a12eaac6..dec5824c 100644 --- a/cinelerra-5.1/cinelerra/pluginserver.C +++ b/cinelerra-5.1/cinelerra/pluginserver.C @@ -661,7 +661,6 @@ void PluginServer::render_gui(void *data, int size) PluginGUIs::PluginGUIs(MWindow *mwindow) { this->mwindow = mwindow; - this->next_id = 0; } PluginGUIs::~PluginGUIs() { @@ -669,7 +668,7 @@ PluginGUIs::~PluginGUIs() void PluginGUIs::append(PluginServer *server) { - server->gui_id = next_id++; + server->gui_id = EDL::next_id(); ArrayList::append(server); } @@ -1028,7 +1027,7 @@ void PluginServer::get_defaults_path(char *path) switch( plugin_type ) { case PLUGIN_TYPE_FFMPEG: case PLUGIN_TYPE_LV2: - strcpy(string2, client->plugin_title()); + strcpy(string2, title); break; case PLUGIN_TYPE_BUILTIN: case PLUGIN_TYPE_LADSPA: @@ -1174,16 +1173,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); }