X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fedl.C;h=d033b8d5377c00401f16be10989748eb12494041;hp=102c975bc3139520e45b884fa69c864bafe4482f;hb=15b020d5c21b2cc5545227f7c092f06086666b4a;hpb=6fa206c4d00a5bb7418289064dd8466ff477f787 diff --git a/cinelerra-5.1/cinelerra/edl.C b/cinelerra-5.1/cinelerra/edl.C index 102c975b..d033b8d5 100644 --- a/cinelerra-5.1/cinelerra/edl.C +++ b/cinelerra-5.1/cinelerra/edl.C @@ -795,20 +795,22 @@ int EDL::clear(double start, double end, return 0; } -class Zone { public: Track *track; int64_t start, end; }; +static int dead_edit_cmp(Edit**ap, Edit**bp) +{ + Edit *a = *ap, *b = *bp; + if( a->track != b->track ) return 0; + return a->startproject > b->startproject ? -1 : 1; +} void EDL::delete_edits(ArrayList *edits, int collapse) { - if( session->labels_follow_edits ) - delete_edit_labels(edits, collapse); - ArrayList zones; + edits->sort(dead_edit_cmp); for( int i=0; isize(); ++i ) { Edit *edit = edits->get(i); Track *track = edit->track; int64_t start = edit->startproject; - int64_t end = start + edit->length; - Zone &zone = zones.append(); - zone.track = track; zone.start = start; zone.end = end; + int64_t length = edit->length; + int64_t end = start + length; if( session->autos_follow_edits ) { track->automation->clear(start, end, 0, collapse); } @@ -817,21 +819,18 @@ void EDL::delete_edits(ArrayList *edits, int collapse) PluginSet *plugin_set = track->plugin_set[k]; plugin_set->clear(start, end, 1); if( !collapse ) - plugin_set->paste_silence(start, end); + plugin_set->paste_silence(start, end, 1); + plugin_set->optimize(); } } - track->optimize(); - } - for( int i=0; iedits->clear(start, end); - if( !collapse ) - track->edits->paste_silence(start, end); - track->optimize(); + Edit *dead_edit = edit; + if( collapse ) { + while( (edit=edit->next) ) + edit->startproject -= length; + } + delete dead_edit; + track->edits->optimize(); } - optimize(); } class Range { @@ -911,58 +910,33 @@ void EDL::move_edit_labels(ArrayList *edits, double dist) } -void EDL::modify_edithandles(double oldposition, - double newposition, - int currentend, - int handle_mode, - int edit_labels, - int edit_plugins, - int edit_autos) +void EDL::modify_edithandles(double oldposition, double newposition, + int currentend, int handle_mode, int edit_labels, + int edit_plugins, int edit_autos, int group_id) { - tracks->modify_edithandles(oldposition, - newposition, - currentend, - handle_mode, - edit_labels, - edit_plugins, - edit_autos); - labels->modify_handles(oldposition, - newposition, - currentend, - handle_mode, - edit_labels); -} - -void EDL::modify_pluginhandles(double oldposition, - double newposition, - int currentend, - int handle_mode, - int edit_labels, - int edit_autos, - Edits *trim_edits) -{ - tracks->modify_pluginhandles(oldposition, - newposition, - currentend, - handle_mode, - edit_labels, - edit_autos, - trim_edits); + tracks->modify_edithandles(oldposition, newposition, + currentend, handle_mode, edit_labels, + edit_plugins, edit_autos, group_id); + labels->modify_handles(oldposition, newposition, + currentend, handle_mode, edit_labels); +} + +void EDL::modify_pluginhandles(double oldposition, double newposition, + int currentend, int handle_mode, int edit_labels, + int edit_autos, Edits *trim_edits) +{ + tracks->modify_pluginhandles(oldposition, newposition, + currentend, handle_mode, edit_labels, + edit_autos, trim_edits); optimize(); } -void EDL::paste_silence(double start, - double end, - int edit_labels, - int edit_plugins, - int edit_autos) +void EDL::paste_silence(double start, double end, + int edit_labels, int edit_plugins, int edit_autos) { if( edit_labels ) labels->paste_silence(start, end); - tracks->paste_silence(start, - end, - edit_plugins, - edit_autos); + tracks->paste_silence(start, end, edit_plugins, edit_autos); }