4 #include "indexstate.h"
5 #include "nestededls.h"
8 NestedEDLs::NestedEDLs()
12 NestedEDLs::~NestedEDLs()
14 for(int i = 0; i < nested_edls.size(); i++)
15 nested_edls.get(i)->Garbage::remove_user();
16 nested_edls.remove_all();
19 int NestedEDLs::size()
21 return nested_edls.size();
24 EDL* NestedEDLs::get(int number)
26 return nested_edls.get(number);
29 EDL* NestedEDLs::get_copy(EDL *src)
32 for(int i = 0; i < nested_edls.size(); i++)
34 EDL *dst = nested_edls.get(i);
35 if(!strcmp(dst->path, src->path))
40 dst->create_objects();
42 nested_edls.append(dst);
46 EDL* NestedEDLs::get(char *path)
48 for(int i = 0; i < nested_edls.size(); i++)
50 EDL *dst = nested_edls.get(i);
51 if(!strcmp(dst->path, path))
56 dst->create_objects();
58 xml_file.read_from_file(path);
59 //printf("NestedEDLs::get %d %s\n", __LINE__, path);
60 dst->load_xml(&xml_file, LOAD_ALL);
62 // Override path EDL was saved to with the path it was loaded from.
64 nested_edls.append(dst);
68 void NestedEDLs::clear()
70 for(int i = 0; i < nested_edls.size(); i++)
71 nested_edls.get(i)->Garbage::remove_user();
72 nested_edls.remove_all();
76 void NestedEDLs::update_index(EDL *nested_edl)
78 for(int i = 0; i < nested_edls.size(); i++)
80 EDL *current = nested_edls.get(i);
81 if(!strcmp(current->path, nested_edl->path))
83 // printf("NestedEDLs::update_index %d %p %d\n",
85 // current->index_state,
86 // nested_edl->index_state->index_status);
87 current->update_index(nested_edl);
92 void NestedEDLs::remove_edl(EDL *nested_edl)
94 nested_edls.remove(nested_edl);
95 nested_edl->Garbage::remove_user();