X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fplugindialog.C;h=8063982bfe8ffa652b11cf624af470f050b76e17;hb=13a039ef755e81e65c9479b4b615fd89bfe3e038;hp=f9c24fffb9c41c8948f2b254e9b6dabbe8fde1c6;hpb=12d4e343f31707c899e6e4daa10c68b172433cff;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/plugindialog.C b/cinelerra-5.1/cinelerra/plugindialog.C index f9c24fff..8063982b 100644 --- a/cinelerra-5.1/cinelerra/plugindialog.C +++ b/cinelerra-5.1/cinelerra/plugindialog.C @@ -435,8 +435,10 @@ void PluginDialog::apply() void PluginDialogThread::apply() { - if( mwindow->edl ) - mwindow->edl->session->single_standalone = single_standalone; + Plugin *plugin = 0; + EDL *edl = mwindow->edl; + if( edl ) + edl->session->single_standalone = single_standalone; if(plugin_type) { mwindow->gui->lock_window("PluginDialogThread::run 3"); mwindow->undo->update_undo_before(); @@ -444,16 +446,20 @@ void PluginDialogThread::apply() mwindow->insert_effect(plugin_title, &shared_location, data_type, plugin_type, single_standalone); } - else { - Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id); - if( plugin ) { - plugin->change_plugin(plugin_title, + else if( (plugin=edl->tracks->plugin_exists(plugin_id)) != 0 ) { + plugin->change_plugin(plugin_title, &shared_location, plugin_type); + } + else if( edl->tracks->track_exists(track) ) { + double start = edl->local_session->get_selectionstart(1); + double end = edl->local_session->get_selectionend(1); + if( start >= end ) { + start = 0; + end = track->get_length(); } - else if( mwindow->edl->tracks->track_exists(track) ) { - mwindow->insert_effect(plugin_title, &shared_location, - track, 0, 0, 0, plugin_type); - } + double length = end - start; + mwindow->insert_effect(plugin_title, &shared_location, + track, 0, start, length, plugin_type); } mwindow->save_backup();