return 1;
}
-int FileXML::read_data_until(const char *tag_end, char *out, int len)
+int FileXML::read_data_until(const char *tag_end, char *out, int len, int skip)
{
long ipos = buffer->itell();
int opos = 0, pos = -1;
++pos;
}
// if end tag is reached, pos is left on the < of the end tag
- if( pos >= 0 && !tag_end[pos] )
+ if( !skip && pos >= 0 && !tag_end[pos] && !skip )
buffer->iseek(ipos);
return opos;
}
-int FileXML::read_text_until(const char *tag_end, char *out, int len)
+int FileXML::read_text_until(const char *tag_end, char *out, int len, int skip)
{
char data[len+1];
- int opos = read_data_until(tag_end, data, len);
+ int opos = read_data_until(tag_end, data, len, skip);
decode(out, data, opos);
return 0;
}
int append_data(const char *text, long len);
char* read_text();
- 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_data_until(const char *tag_end, char *out, int len, int skip=0);
+ int read_text_until(const char *tag_end, char *out, int len, int skip=0);
int read_tag();
int skip_tag();
int write_to_file(const char *filename);
// position = file->tag.get_property((char*)"POSITION", position);
//printf("KeyFrame::load 1\n");
- int len = file->read_data_until((char*)"/KEYFRAME", data, MESSAGESIZE-1);
+ int len = file->read_data_until((char*)"/KEYFRAME", data, MESSAGESIZE-1, 1);
data[len] = 0;
//printf("KeyFrame::load 2 data=\n%s\nend of data\n", data);
}
file->tag.set_property("SELECTION_START", selectionstart - start);
file->tag.set_property("SELECTION_END", selectionend - start);
file->tag.set_property("CLIP_TITLE", clip_title);
- file->tag.set_property("CLIP_NOTES", clip_notes);
file->tag.set_property("CLIP_ICON", clip_icon);
file->tag.set_property("AWINDOW_FOLDER", awindow_folder);
file->tag.set_property("X_PANE", x_pane);
}
}
file->append_tag();
+ file->append_newline();
+
+//this used to be a property, now used as tag member
+// file->tag.set_property("CLIP_NOTES", clip_notes);
+ file->tag.set_title("CLIP_NOTES"); file->append_tag();
+ file->append_text(clip_notes);
+ file->tag.set_title("/CLIP_NOTES"); file->append_tag();
+ file->append_newline();
file->tag.set_title("/LOCALSESSION");
file->append_tag();
// clipboard_length = 0;
// Overwritten by MWindow::load_filenames
file->tag.get_property("CLIP_TITLE", clip_title);
+ clip_notes[0] = 0;
file->tag.get_property("CLIP_NOTES", clip_notes);
clip_icon[0] = 0;
file->tag.get_property("CLIP_ICON", clip_icon);
in_point = file->tag.get_property("IN_POINT", (double)-1);
out_point = file->tag.get_property("OUT_POINT", (double)-1);
}
+
+ while( !file->read_tag() ) {
+ if( file->tag.title_is("/LOCALSESSION") ) break;
+ if( file->tag.title_is("CLIP_NOTES") ) {
+ file->read_text_until("/CLIP_NOTES",
+ clip_notes, sizeof(clip_notes)-1, 1);
+ }
+ }
}
void LocalSession::boundaries()
if( playback_engine->is_playing_back )
stop_playback(1);
- gui->lock_window("VWindow::change_source 2");
// if(asset && this->asset &&
// asset->id == this->asset->id &&
// asset == this->asset) return;
+ gui->lock_window("VWindow::change_source 2");
//printf("VWindow::change_source %d\n", __LINE__);