X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ftrack.C;h=05bb50365446eeaddbda67a3b00b8273ac6a4445;hb=0983c78067d86d25426fd34655ad9a9992ef04c7;hp=10460c0cff35d959a5bfff45a763faf8d45cacd5;hpb=05bf5047966713579bd8e7a692fda3b49bc43450;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/track.C b/cinelerra-5.1/cinelerra/track.C index 10460c0c..05bb5036 100644 --- a/cinelerra-5.1/cinelerra/track.C +++ b/cinelerra-5.1/cinelerra/track.C @@ -339,7 +339,7 @@ int Track::load(FileXML *file, int track_offset, uint32_t load_flags) else if(file->tag.title_is("TITLE")) { - file->read_text_until("/TITLE", title, BCTEXTLEN); + result = file->skip_tag(); } else if(load_flags && automation->load(file) @@ -352,6 +352,8 @@ int Track::load(FileXML *file, int track_offset, uint32_t load_flags) { if(load_flags & LOAD_EDITS) edits->load(file, track_offset); + else + result = file->skip_tag(); } else if(file->tag.title_is("PLUGINSET")) @@ -372,6 +374,8 @@ int Track::load(FileXML *file, int track_offset, uint32_t load_flags) current_plugin++; } } + else + result = file->skip_tag(); } else load_derived(file, load_flags); @@ -1541,7 +1545,10 @@ void Track::shuffle_edits(double start, double end, int first_track) int index = rand() % new_edits.size(); Edit *edit = new_edits.get(index); new_edits.remove_number(index); - edits->insert_after(start_edit, edit); + if( !start_edit ) + edits->insert_before(edits->first, edit); + else + edits->insert_after(start_edit, edit); start_edit = edit; // Recalculate start position @@ -1564,20 +1571,18 @@ void Track::shuffle_edits(double start, double end, int first_track) if(first_track && edl->session->labels_follow_edits) { double start_seconds1 = from_units(startproject1); + double end_seconds1 = from_units(startproject1 + edit->length); double start_seconds2 = from_units(startproject2); - //double end_seconds1 = from_units(edit->startproject + - // edit->length); for(int i = new_labels.size() - 1; i >= 0; i--) { Label *label = new_labels.get(i); // Was in old edit position if(label->position >= start_seconds1 && - label->position < start_seconds2) + label->position < end_seconds1) { // Move to new edit position double position = label->position - - start_seconds1 + - start_seconds2; + start_seconds1 + start_seconds2; edl->labels->insert_label(position); new_labels.remove_object_number(i); } @@ -1657,7 +1662,10 @@ void Track::reverse_edits(double start, double end, int first_track) int index = new_edits.size() - 1; Edit *edit = new_edits.get(index); new_edits.remove_number(index); - edits->insert_after(start_edit, edit); + if( !start_edit ) + edits->insert_before(edits->first, edit); + else + edits->insert_after(start_edit, edit); start_edit = edit; // Recalculate start position @@ -1680,19 +1688,18 @@ void Track::reverse_edits(double start, double end, int first_track) if(first_track && edl->session->labels_follow_edits) { double start_seconds1 = from_units(startproject1); + double end_seconds1 = from_units(startproject1 + edit->length); double start_seconds2 = from_units(startproject2); - //double end_seconds1 = from_units(edit->startproject + edit->length); for(int i = new_labels.size() - 1; i >= 0; i--) { Label *label = new_labels.get(i); // Was in old edit position if(label->position >= start_seconds1 && - label->position < start_seconds2) + label->position < end_seconds1) { // Move to new edit position double position = label->position - - start_seconds1 + - start_seconds2; + start_seconds1 + start_seconds2; edl->labels->insert_label(position); new_labels.remove_object_number(i); }