xml.tag.set_property("TIME", cut->time);
xml.tag.set_property("ACTION", cut->action);
xml.append_tag();
+ xml.tag.set_title("/CUT");
+ xml.append_tag();
xml.append_newline();
}
file.tag.set_title("JOB");
jobs.values[i]->save(&file);
}
+ file.tag.set_title("/JOBS");
+ file.append_tag();
+ file.append_newline();
if(path[0])
file.write_to_file(path);
file->tag.set_title("NESTED_EDL");
file->tag.set_property("SRC", nested_edl->path);
file->append_tag();
+ file->tag.set_title("/NESTED_EDL");
+ file->append_tag();
+ file->append_newline();
}
if(asset)
if((load_flags & LOAD_VCONFIG) &&
(load_flags & LOAD_SESSION))
session->load_video_config(file, 0, load_flags);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is("AUDIO"))
if((load_flags & LOAD_ACONFIG) &&
(load_flags & LOAD_SESSION))
session->load_audio_config(file, 0, load_flags);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is("FOLDER"))
{
if(load_flags & LOAD_ASSETS)
assets->load(file, load_flags);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is(labels->xml_tag))
{
if(load_flags & LOAD_TIMEBAR)
labels->load(file, load_flags);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is("LOCALSESSION"))
if((load_flags & LOAD_SESSION) ||
(load_flags & LOAD_TIMEBAR))
local_session->load_xml(file, load_flags);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is("SESSION"))
if((load_flags & LOAD_SESSION) &&
!parent_edl)
session->load_xml(file, 0, load_flags);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is("TRACK"))
return tag.read_tag(this);
}
+int FileXML::skip_tag()
+{
+ char tag_title[sizeof(tag.title)];
+ strcpy(tag_title, tag.title);
+ int n = 1;
+ while( !read_tag() ) {
+ if( tag.title[0] == tag_title[0] ) {
+ if( !strcasecmp(&tag_title[1], &tag.title[1]) ) ++n;
+ }
+ else if( tag.title[0] != '/' ) continue;
+ else if( strcasecmp(&tag_title[0], &tag.title[1]) ) continue;
+ else if( --n <= 0 ) return 0;
+ }
+ return 1;
+}
+
int FileXML::read_data_until(const char *tag_end, char *out, int len)
{
long ipos = buffer->itell();
int read_data_until(const char *tag_end, char *out, int len);
int read_text_until(const char *tag_end, char *out, int len);
int read_tag();
+ int skip_tag();
int write_to_file(const char *filename);
int write_to_file(FILE *file, const char *filename="");
int read_from_file(const char *filename, int ignore_error = 0);
file->tag.set_title("OFFSET");
file->tag.set_property("FLOAT", index_entries[i]->offset);
file->append_tag();
+ file->tag.set_title("/OFFSET");
+ file->append_tag();
file->tag.set_title("SIZE");
file->tag.set_property("FLOAT", index_entries[i]->size);
file->append_tag();
+ file->tag.set_title("/SIZE");
+ file->append_tag();
+ file->append_newline();
}
file->append_newline();
xml.tag.set_property("TIME", del->time);
xml.tag.set_property("ACTION", del->action);
xml.append_tag();
+ xml.tag.set_title("/DEL");
+ xml.append_tag();
xml.append_newline();
}
xml.tag.set_property("START", start);
xml.tag.set_property("END", end);
xml.append_tag();
+ xml.tag.set_title("/CLIP");
+ xml.append_tag();
xml.append_newline();
}
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)
{
if(load_flags & LOAD_EDITS)
edits->load(file, track_offset);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is("PLUGINSET"))
current_plugin++;
}
}
+ else
+ result = file->skip_tag();
}
else
load_derived(file, load_flags);
switch(time_format) {
case TIME_SECONDS: {
- seconds = fabs(seconds);
+// add 1.0e-6 to prevent round off truncation from glitching a bunch of digits
+ seconds = fabs(seconds) + 1.0e-6;
second = seconds;
seconds -= (int64_t)seconds;
thousandths = (int64_t)(seconds*1000) % 1000;
break; }
case TIME_HMS: {
- seconds = fabs(seconds);
+ seconds = fabs(seconds) + 1.0e-6;
hour = seconds/3600;
minute = seconds/60 - hour*60;
second = seconds - (hour*3600 + minute*60);
break; }
case TIME_HMS2: {
- seconds = fabs(seconds);
+ seconds = fabs(seconds) + 1.0e-6;
hour = seconds/3600;
minute = seconds/60 - hour*60;
second = seconds - (hour*3600 + minute*60);
break; }
case TIME_HMS3: {
- seconds = fabs(seconds);
+ seconds = fabs(seconds) + 1.0e-6;
hour = seconds/3600;
minute = seconds/60 - hour*60;
second = seconds - (hour*3600 + minute*60);
break; }
case TIME_HMSF: {
- seconds = fabs(seconds);
+ seconds = fabs(seconds) + 1.0e-6;
hour = seconds/3600;
minute = seconds/60 - hour*60;
second = seconds - (hour*3600 + minute*60);
break; }
case TIME_MS1: {
- seconds = fabs(seconds);
+ seconds = fabs(seconds) + 1.0e-6;
minute = seconds/60;
second = seconds - minute*60;
sprintf(text, "%d:%02d", minute, second);
case TIME_MS2: {
int sign = seconds >= 0 ? '+' : '-';
- seconds = fabs(seconds);
+ seconds = fabs(seconds) + 1.0e-6;
minute = seconds/60;
second = seconds - minute*60;
sprintf(text, "%c%d:%02d", sign, minute, second);
file->tag.set_property("PHASE", (float)phase);
file->tag.set_property("FREQFACTOR", (float)freq_factor);
file->append_tag();
+ file->tag.set_title("/OSCILLATOR");
+ file->append_tag();
file->append_newline();
}
output.tag.set_property("AUTOMATIC", config.automatic);
output.tag.set_property("AUTO_THRESHOLD", config.auto_threshold);
output.append_tag();
+ output.tag.set_title("/RGB601");
+ output.append_tag();
output.terminate_string();
}
file->tag.set_property("PHASE", (float)phase);
file->tag.set_property("FREQFACTOR", (float)freq_factor);
file->append_tag();
+ file->tag.set_title("/OSCILLATOR");
+ file->append_tag();
file->append_newline();
}
if(config.avg_vertical) {
output.tag.set_title("VERTICAL");
output.append_tag();
+ output.tag.set_title("/VERTICAL");
+ output.append_tag();
}
if(config.int_horizontal) {
output.tag.set_title("HORIZONTAL");
output.append_tag();
+ output.tag.set_title("/HORIZONTAL");
+ output.append_tag();
}
if(config.inpainting ) {
output.tag.set_title("INPAINTING");
output.append_tag();
+ output.tag.set_title("/INPAINTING");
+ output.append_tag();
}
+ output.tag.set_title("/YUV411");
+ output.append_tag();
output.terminate_string();
}