本文整理汇总了C++中FileXML::read_from_file方法的典型用法代码示例。如果您正苦于以下问题:C++ FileXML::read_from_file方法的具体用法?C++ FileXML::read_from_file怎么用?C++ FileXML::read_from_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileXML
的用法示例。
在下文中一共展示了FileXML::read_from_file方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
int Commercials::
read_ads(const char *filename)
{
char index_filename[BCTEXTLEN], source_filename[BCTEXTLEN];
IndexFile::get_index_filename(source_filename,
mwindow->preferences->index_directory, index_filename,
filename, ".ads");
tracks.remove_all_objects();
FileXML xml;
if( xml.read_from_file(index_filename, 1) ) return 1;
do {
if( xml.read_tag() ) return 1;
} while( !xml.tag.title_is("ADS") );
for(;;) {
if( xml.read_tag() ) return 1;
if( xml.tag.title_is("/ADS") ) break;
if( xml.tag.title_is("CLIPS") ) {
int pid = xml.tag.get_property("PID", (int)0);
Clips *clips = new Clips(pid);
tracks.append(clips);
if( clips->load(xml) ) return 1;
if( !xml.tag.title_is("/CLIPS") ) break;
}
}
return 0;
}
示例2: load
void ChannelDB::load(const char *filename)
{
if( !filename ) return;
FileXML file;
char path[BCTEXTLEN];
prefix_to_path(path, filename);
channels.remove_all_objects();
int done = file.read_from_file(path, 1);
channels.remove_all_objects();
// Load channels
while(!done)
{
Channel *channel = new Channel;
if(!(done = channel->load(&file)))
channels.append(channel);
else
{
delete channel;
}
}
}
示例3: load_jobs
void BatchRenderThread::load_jobs(char *path, Preferences *preferences)
{
FileXML file;
int result = 0;
jobs.remove_all_objects();
if(path[0])
file.read_from_file(path);
else
file.read_from_file(create_path(path));
while(!result)
{
if(!(result = file.read_tag()))
{
if(file.tag.title_is("JOB"))
{
BatchRenderJob *job;
jobs.append(job = new BatchRenderJob(preferences));
job->load(&file);
}
}
}
}
示例4: calculate_dest_paths
void BatchRenderThread::calculate_dest_paths(ArrayList<char*> *paths,
Preferences *preferences)
{
for(int i = 0; i < jobs.total; i++)
{
BatchRenderJob *job = jobs.values[i];
if(job->enabled && *job->edl_path != '@')
{
PackageDispatcher *packages = new PackageDispatcher;
// Load EDL
TransportCommand *command = new TransportCommand;
FileXML *file = new FileXML;
file->read_from_file(job->edl_path);
// Use command to calculate range.
command->command = NORMAL_FWD;
command->get_edl()->load_xml(file,
LOAD_ALL);
command->change_type = CHANGE_ALL;
command->set_playback_range();
command->adjust_playback_range();
// Create test packages
packages->create_packages(mwindow,
command->get_edl(),
preferences,
job->strategy,
job->asset,
command->start_position,
command->end_position,
0);
// Append output paths allocated to total
for(int j = 0; j < packages->get_total_packages(); j++)
{
RenderPackage *package = packages->get_package(j);
paths->append(cstrdup(package->path));
}
// Delete package harness
delete packages;
delete command;
delete file;
}
}
}
示例5: run
void RenderThread::run()
{
if(render->mode == Render::INTERACTIVE)
{
render_single(1, render->asset, mwindow->edl, render->strategy);
}
else
if(render->mode == Render::BATCH)
{
// PRINT_TRACE
// printf("RenderThread::run %d %d %d\n",
// __LINE__,
// render->jobs->total,
// render->result);
for(int i = 0; i < render->jobs->total && !render->result; i++)
{
//PRINT_TRACE
BatchRenderJob *job = render->jobs->values[i];
//PRINT_TRACE
if(job->enabled)
{
if(mwindow)
{
mwindow->batch_render->update_active(i);
}
else
{
printf("Render::run: %s\n", job->edl_path);
}
//PRINT_TRACE
FileXML *file = new FileXML;
EDL *edl = new EDL;
edl->create_objects();
file->read_from_file(job->edl_path);
edl->load_xml(file, LOAD_ALL);
//PRINT_TRACE
render_single(0, job->asset, edl, job->strategy);
//PRINT_TRACE
edl->Garbage::remove_user();
delete file;
if(!render->result)
{
if(mwindow)
mwindow->batch_render->update_done(i, 1, render->elapsed_time);
else
{
char string[BCTEXTLEN];
render->elapsed_time =
(double)render->progress_timer->get_scaled_difference(1);
Units::totext(string,
render->elapsed_time,
TIME_HMS2);
printf("Render::run: done in %s\n", string);
}
}
else
{
if(mwindow)
mwindow->batch_render->update_active(-1);
else
printf("Render::run: failed\n");
}
}
//PRINT_TRACE
}
if(mwindow)
{
mwindow->batch_render->update_active(-1);
mwindow->batch_render->update_done(-1, 0, 0);
}
}
}
示例6: run
void Render::run()
{
int format_error;
result = 0;
if(mode == Render::INTERACTIVE)
{
// Fix the asset for rendering
printf("Render::run 1\n");
Asset *asset = new Asset;
load_defaults(asset);
printf("Render::run 2\n");
check_asset(mwindow->edl, *asset);
printf("Render::run 3\n");
// Get format from user
if(!result)
{
printf("Render::run 4\n");
do
{
format_error = 0;
result = 0;
{
printf("Render::run 5\n");
RenderWindow window(mwindow, this, asset);
printf("Render::run 6\n");
window.create_objects();
printf("Render::run 7\n");
result = window.run_window();
printf("Render::run 8\n");
if (! result) {
// add to recentlist only on OK
window.format_tools->path_recent->add_item(FILE_FORMAT_PREFIX(asset->format), asset->path);
}
}
if(!result)
{
printf("Render::run 8.1\n");
// Check the asset format for errors.
FormatCheck format_check(asset);
printf("Render::run 8.2\n");
format_error = format_check.check_format();
printf("Render::run 8.3\n");
}
}while(format_error && !result);
}
printf("Render::run 9\n");
save_defaults(asset);
mwindow->save_defaults();
printf("Render::run 10\n");
if(!result) render(1, asset, mwindow->edl, strategy, range_type);
printf("Render::run 11\n");
Garbage::delete_object(asset);
printf("Render::run 12\n");
}
else
if(mode == Render::BATCH)
{
for(int i = 0; i < jobs->total && !result; i++)
{
BatchRenderJob *job = jobs->values[i];
if(job->enabled)
{
if(mwindow)
{
mwindow->batch_render->update_active(i);
}
else
{
printf("Render::run: %s\n", job->edl_path);
}
FileXML *file = new FileXML;
EDL *edl = new EDL;
edl->create_objects();
file->read_from_file(job->edl_path);
if(!plugindb && mwindow)
plugindb = mwindow->plugindb;
edl->load_xml(plugindb, file, LOAD_ALL);
check_asset(edl, *job->asset);
render(0, job->asset, edl, job->strategy, RANGE_BACKCOMPAT);
delete edl;
delete file;
if(!result)
{
if(mwindow)
mwindow->batch_render->update_done(i, 1, elapsed_time);
else
{
//.........这里部分代码省略.........