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
// The string is not terminated in this call.
int EDL::save_xml(FileXML *file, const char *output_path)
{
- copy(0, tracks->total_length(), 1, file, output_path, 0);
+ copy(1, file, output_path, 0);
return 0;
}
return copy(start, end, all,
"/EDL", file, output_path, rewind_it);
}
+int EDL::copy(int all, FileXML *file, const char *output_path, int rewind_it)
+{
+ return copy(0, tracks->total_length(), all, file, output_path, rewind_it);
+}
int EDL::copy_clip(double start, double end, int all,
FileXML *file, const char *output_path, int rewind_it)
return copy(start, end, all,
"/CLIP_EDL", file, output_path, rewind_it);
}
+int EDL::copy_clip(int all, FileXML *file, const char *output_path, int rewind_it)
+{
+ return copy_clip(0, tracks->total_length(), all, file, output_path, rewind_it);
+}
+
int EDL::copy_nested_edl(double start, double end, int all,
FileXML *file, const char *output_path, int rewind_it)
{
return copy(start, end, all,
"/NESTED_EDL", file, output_path, rewind_it);
}
+int EDL::copy_nested_edl(int all, FileXML *file, const char *output_path, int rewind_it)
+{
+ return copy_nested_edl(0, tracks->total_length(), all, file, output_path, rewind_it);
+}
+
int EDL::copy_vwindow_edl(double start, double end, int all,
FileXML *file, const char *output_path, int rewind_it)
{
return copy(start, end, all,
"/VWINDOW_EDL", file, output_path, rewind_it);
}
+int EDL::copy_vwindow_edl(int all, FileXML *file, const char *output_path, int rewind_it)
+{
+ return copy_vwindow_edl(0, tracks->total_length(), all, file, output_path, rewind_it);
+}
+
int EDL::copy(double start, double end, int all,
const char *closer, FileXML *file,
file->append_newline();
}
- copy_assets(start, end, file, all, output_path);
+ if( !parent_edl )
+ copy_assets(start, end, file, all, output_path);
for( int i=0; i<nested_edls.size(); ++i )
nested_edls[i]->copy_nested_edl(0, tracks->total_length(), 1,
// Don't want this if using clipboard
if( all ) {
for( int i=0; i<total_vwindow_edls(); ++i )
- get_vwindow_edl(i)->copy_vwindow_edl(0, tracks->total_length(), 1,
- file, output_path, 0);
+ get_vwindow_edl(i)->copy_vwindow_edl(1, file, output_path, 0);
for( int i=0; i<clips.size(); ++i )
- clips[i]->copy_clip(0, tracks->total_length(), 1,
- file, output_path, 0);
+ clips[i]->copy_clip(1, file, output_path, 0);
mixers.save(file);
}
return 0;
}
-int EDL::to_nested(EDL *nested_edl)
+void EDL::copy_indexables(EDL *edl)
{
-// Keep frame rate, sample rate, and output size unchanged.
-// These parameters would revert the project if VWindow displayed an asset
-// of different size than the project.
+ 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);
+ }
+ }
+}
+
+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(this); // parent for clip edl
+ new_edl->create_objects();
+ new_edl->create_nested(nested);
+ return new_edl;
+}
+void EDL::create_nested(EDL *nested)
+{
+// Keep frame rate, sample rate, and output size unchanged.
// Nest all video & audio outputs
session->video_tracks = 1;
- session->audio_tracks = nested_edl->session->audio_channels;
+ session->audio_tracks = nested->session->audio_channels;
create_default_tracks();
- insert_asset(0, nested_edl, 0, 0, 0);
- return 0;
+ insert_asset(0, nested, 0, 0, 0);
}
-
void EDL::retrack()
{
int min_w = session->output_w, min_h = session->output_h;
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;