- else {
- if( plugin ) {
- if( mwindow->edl->tracks->plugin_exists(plugin) ) {
- plugin->change_plugin(plugin_title,
- &shared_location, plugin_type);
- }
- }
- else {
- if( mwindow->edl->tracks->track_exists(track) ) {
- mwindow->insert_effect(plugin_title, &shared_location,
- track, 0, 0, 0, plugin_type);
- }
+ 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();