- int end = start + edit->length;
- track->clear(start, end, 1, 0,
- session->plugins_follow_edits,
- session->autos_follow_edits, 0);
- if( !collapse )
- track->paste_silence(start, end,
- session->plugins_follow_edits,
- session->autos_follow_edits);
+ int64_t length = edit->length;
+ int64_t end = start + length;
+ if( session->autos_follow_edits ) {
+ track->automation->clear(start, end, 0, collapse);
+ }
+ if( session->plugins_follow_edits ) {
+ for( int k=0; k<track->plugin_set.size(); ++k ) {
+ PluginSet *plugin_set = track->plugin_set[k];
+ plugin_set->clear(start, end, 1);
+ if( !collapse )
+ plugin_set->paste_silence(start, end);
+ }
+ }
+ Edit *dead_edit = edit;
+ if( collapse ) {
+ while( (edit=edit->next) )
+ edit->startproject -= length;
+ }
+ delete dead_edit;