X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fedl.C;h=3c3de37f9aa31b93be26a2eec2dc0dee6ea37bfb;hb=eecf057a9d6b8c8cffc7d0001bff89bc9cac7b05;hp=55b2caf455b25ef7ee355dfdb61d695e151c11ef;hpb=214bd0ba9e21635e03d0c0e2b2ae1a7e9170583c;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/edl.C b/cinelerra-5.1/cinelerra/edl.C index 55b2caf4..3c3de37f 100644 --- a/cinelerra-5.1/cinelerra/edl.C +++ b/cinelerra-5.1/cinelerra/edl.C @@ -298,7 +298,7 @@ int EDL::read_xml(FileXML *file, uint32_t load_flags) nested_edl->create_objects(); nested_edl->read_xml(file, LOAD_ALL); if( (load_flags & LOAD_ALL) == LOAD_ALL ) - nested_edls.add_clip(nested_edl); + nested_edls.get_nested(nested_edl); nested_edl->remove_user(); } else @@ -597,36 +597,47 @@ int EDL::copy(double start, double end, int all, return 0; } -EDL *EDL::get_nested(EDL *nested_edl, const char *path) +void EDL::copy_indexables(EDL *edl) { - for( int i=0; ipath) ) return dst; + for( Track *track=edl->tracks->first; track; track=track->next ) { + for( Edit *edit=track->edits->first; edit; edit=edit->next ) { + if( edit->asset ) + assets->update(edit->asset); + if( edit->nested_edl ) + nested_edls.get_nested(edit->nested_edl); + } } - return new_nested(nested_edl, path); } -EDL *EDL::new_nested(EDL *nested_edl, const char *path) +EDL *EDL::new_nested(EDL *edl, const char *path) +{ + EDL *nested = new EDL; // no parent for nested edl + nested->create_objects(); + nested->copy_session(edl); + nested->set_path(path); + nested->update_index(edl); + nested->copy_indexables(edl); + nested->tracks->copy_from(edl->tracks); + nested_edls.append(nested); + return nested; +} + +EDL *EDL::create_nested_clip(EDL *nested) { - EDL *new_edl = new EDL; // no parent for nested clip + EDL *new_edl = new EDL(this); // parent for clip edl new_edl->create_objects(); - new_edl->copy_session(this); - new_edl->create_nested(nested_edl, path); + new_edl->create_nested(nested); return new_edl; } -void EDL::create_nested(EDL *nested_edl, const char *path) +void EDL::create_nested(EDL *nested) { - set_path(path); - strcpy(local_session->clip_title, path); -// save a ref to nested edl for garbage delete - EDL *nest = clips.get_copy(nested_edl); // Keep frame rate, sample rate, and output size unchanged. // Nest all video & audio outputs session->video_tracks = 1; - session->audio_tracks = nest->session->audio_channels; + session->audio_tracks = nested->session->audio_channels; create_default_tracks(); - insert_asset(0, nest, 0, 0, 0); + insert_asset(0, nested, 0, 0, 0); } void EDL::retrack() @@ -1048,7 +1059,7 @@ void EDL::insert_asset(Asset *asset, EDL *new_nested_edl = 0; if( asset ) new_asset = assets->update(asset); - if( nested_edl ) new_nested_edl = nested_edls.get_copy(nested_edl); + if( nested_edl ) new_nested_edl = nested_edls.get_nested(nested_edl); // Paste video int vtrack = 0;