for( int i=0; !ret && i<jobs.size(); ++i ) {
if( !jobs.values[i]->enabled ) continue;
- const char *path = jobs.values[i]->edl_path;
+ path = jobs.values[i]->edl_path;
int is_script = *path == '@' ? 1 : 0;
if( is_script ) ++path;
FILE *fp = fopen(path, "r");
if( fp ) {
if( warn && mwindow && !is_script ) {
- fseek(fp, 0, SEEK_END);
- int64_t sz = ftell(fp);
- fseek(fp, 0, SEEK_SET);
- char *bfr = new char[sz+1];
- int64_t len = fread(bfr, 1, sz+1, fp);
- if( len == sz ) {
- FileXML file;
- XMLBuffer data(bfr, len, 0);
- file.set_shared_input(&data);
+ char *bfr = 0; size_t sz = 0;
+ struct stat st;
+ if( !fstat(fileno(fp), &st) ) {
+ sz = st.st_size;
+ bfr = new char[sz+1];
+ if( fread(bfr, 1, sz+1, fp) != sz )
+ ret = 1;
+ else
+ bfr[sz] = 0;
+ }
+ if( !ret ) {
EDL *edl = new EDL; edl->create_objects();
- edl->load_xml(&file, LOAD_ALL);
+ XMLBuffer data(bfr, sz, 0);
+ { FileXML file;
+ file.set_shared_input(&data);
+ edl->load_xml(&file, LOAD_ALL); }
double pos = edl->equivalent_output(mwindow->edl);
if( pos >= 0 ) ++not_equiv;
edl->remove_user();
}
- else
- ret = 1;
delete [] bfr;
}
fclose(fp);
//PRINT_TRACE
// Initialize stuff which MWindow does.
signals->initialize("/tmp/cinelerra_batch%d.dmp");
+ boot_defaults = 0;
MWindow::init_defaults(boot_defaults, config_path);
load_defaults(boot_defaults);
preferences = new Preferences;
int result2 = filewindow.run_window();
if( !result2 ) {
strcpy(thread->batch_path, filewindow.get_submitted_path());
+ thread->gui->lock_window("BatchRenderSaveList::run");
thread->gui->batch_path->update(thread->batch_path);
+ thread->gui->unlock_window();
thread->mwindow->defaults->update("DEFAULT_BATCHLOADPATH", thread->batch_path);
thread->save_jobs(thread->batch_path);
}
int BatchRenderList::column_resize_event()
{
- for( int i = 0; i < BATCHRENDER_COLUMNS; i++ ) {
- thread->list_width[i] = get_column_width(i);
- }
+ int col = 0;
+ thread->list_width[ENABLED_COL] = get_column_width(col++);
+ thread->list_width[LABELED_COL] = get_column_width(col++);
+ if( thread->gui->use_renderfarm )
+ thread->list_width[FARMED_COL] = get_column_width(col++);
+ thread->list_width[OUTPUT_COL] = get_column_width(col++);
+ thread->list_width[EDL_COL] = get_column_width(col++);
+ thread->list_width[ELAPSED_COL] = get_column_width(col);
return 1;
}