X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fclipedls.C;fp=cinelerra-5.1%2Fcinelerra%2Fclipedls.C;h=65dd58e2c23fc3b36d038189d3bfff46dd5ada7b;hb=4a90ef3ae46465c0634f81916b79e279e4bd9961;hp=0000000000000000000000000000000000000000;hpb=f87479bd556ea7db4afdd02297fc00977412b873;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/clipedls.C b/cinelerra-5.1/cinelerra/clipedls.C new file mode 100644 index 00000000..65dd58e2 --- /dev/null +++ b/cinelerra-5.1/cinelerra/clipedls.C @@ -0,0 +1,93 @@ +#include "bcsignals.h" +#include "clipedls.h" +#include "edl.h" +#include "filexml.h" +#include "indexstate.h" + + +ClipEDLs::ClipEDLs() +{ +} + +ClipEDLs::~ClipEDLs() +{ + clear(); +} + +void ClipEDLs::clear() +{ + for( int i=0; iremove_user(); + remove_all(); +} + +void ClipEDLs::add_clip(EDL *edl) +{ + append(edl); + edl->add_user(); +} + +void ClipEDLs::remove_clip(EDL *clip) +{ + int n = size(); + remove(clip); + n -= size(); + while( --n >= 0 ) clip->remove_user(); +} + + +EDL* ClipEDLs::get_copy(EDL *src) +{ + if( !src ) return 0; + for( int i=0; ipath, src->path) ) return dst; + } + + EDL *dst = new EDL; + dst->create_objects(); + dst->copy_all(src); + append(dst); + return dst; +} + +EDL* ClipEDLs::load(char *path) +{ + for( int i=0; ipath, path) ) return dst; + } + + EDL *dst = new EDL; + dst->create_objects(); + + FileXML xml_file; + xml_file.read_from_file(path); + dst->load_xml(&xml_file, LOAD_ALL); + +// Override path EDL was saved to with the path it was loaded from. + dst->set_path(path); + append(dst); + return dst; +} + +void ClipEDLs::copy_nested(ClipEDLs &nested) +{ + clear(); + for( int i=0; icreate_objects(); + new_edl->copy_all(nested[i]); + append(new_edl); + } +} + +void ClipEDLs::update_index(EDL *clip_edl) +{ + for( int i=0; ipath, clip_edl->path) ) { + current->update_index(clip_edl); + } + } +} +