-// 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
- {
- length += cut_length;
- }
- }
- else
- if(edit_mode == MOVE_NO_EDITS)
- {
- startsource += cut_length;
- }
- return 0;
-}