- else
-// Does nothing for plugins
- if(edit_mode == MOVE_NO_EDITS)
- {
-//printf("Edit::shift_end_in 3\n");
- int64_t end_source = get_source_end(1);
- if(end_source > 0 && startsource < cut_length)
- {
- cut_length = startsource;
- }
- startsource -= cut_length;
- }
- return 0;
-}
-
-int Edit::shift_end_out(int edit_mode,
- int64_t newposition,
- int64_t oldposition,
- int edit_edits,
- int edit_labels,
- int edit_plugins,
- int edit_autos,
- Edits *trim_edits)
-{
- int64_t cut_length = newposition - oldposition;
- int64_t endsource = get_source_end(startsource + length + cut_length);
-
-// check end of edit against end of source file
- if(endsource > 0 && startsource + length + cut_length > endsource)
- cut_length = endsource - startsource - length;
-
-//printf("Edit::shift_end_out 1 %jd %d %d %d\n", oldposition, newposition, this->length, cut_length);
- if(edit_mode == MOVE_ALL_EDITS)
- {
-// Extend length
- this->length += cut_length;
-
-// Effects are shifted in length extension
- if(edit_plugins)
- edits->shift_effects_recursive(oldposition /* startproject */,
- cut_length,
- edit_autos);
- if(edit_autos)
- edits->shift_keyframes_recursive(oldposition /* startproject */,
- cut_length);
-
- for(Edit* current_edit = next; current_edit; current_edit = current_edit->next)
- {
- current_edit->startproject += cut_length;
- }
- }
- else
- if(edit_mode == MOVE_ONE_EDIT)
- {
- if(next)
- {
- if(cut_length < next->length)
- {
- length += cut_length;
- next->startproject += cut_length;
- next->startsource += cut_length;
- next->length -= cut_length;
-//printf("Edit::shift_end_out %d cut_length=%d\n", __LINE__, cut_length);
- }
- else
- {
-//printf("Edit::shift_end_out %d cut_length=%d next->length=%d\n", __LINE__, cut_length, next->length);
- cut_length = next->length;
- next->startproject += next->length;
- next->startsource += next->length;
- next->length = 0;
- length += cut_length;
-//track->dump();
- }
+ else if( rest_moved ) {
+ if( edit_labels ) {
+ double cut_len = track->from_units(cut_length);
+ double end_pos = edits->track->from_units(end);
+ if( cut_len < 0 )
+ edits->edl->labels->clear(end_pos + cut_len, end_pos, 1);
+ else if( cut_len > 0 )
+ edits->edl->labels->insert(end_pos, cut_len);