projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Typo: 'suposidly' -> 'supposedly'.
[synfig.git]
/
synfig-core
/
trunk
/
src
/
tool
/
main.cpp
diff --git
a/synfig-core/trunk/src/tool/main.cpp
b/synfig-core/trunk/src/tool/main.cpp
index
c7120de
..
d74f3cf
100644
(file)
--- a/
synfig-core/trunk/src/tool/main.cpp
+++ b/
synfig-core/trunk/src/tool/main.cpp
@@
-1,20
+1,22
@@
/* === S Y N F I G ========================================================= */
/* === S Y N F I G ========================================================= */
-/*! \file main.cpp
+/*! \file
tool/
main.cpp
** \brief SYNFIG Tool
**
** \brief SYNFIG Tool
**
-** $Id
: main.cpp,v 1.9 2005/01/23 04:41:10 darco Exp
$
+** $Id$
**
** \legal
**
** \legal
-** Copyright (c) 2002 Robert B. Quattlebaum Jr.
+** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2007 Chris Moore
**
**
-** This software and associated documentation
-** are CONFIDENTIAL and PROPRIETARY property of
-** the above-mentioned copyright holder.
+** This package is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public License as
+** published by the Free Software Foundation; either version 2 of
+** the License, or (at your option) any later version.
**
**
-**
You may not copy, print, publish, or in any
-**
other way distribute this software without
-**
a prior written agreement with
-**
the copyright holder
.
+**
This package is distributed in the hope that it will be useful,
+**
but WITHOUT ANY WARRANTY; without even the implied warranty of
+**
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+**
General Public License for more details
.
** \endlegal
*/
/* ========================================================================= */
** \endlegal
*/
/* ========================================================================= */
@@
-61,12
+63,13
@@
enum exit_code
SYNFIGTOOL_FILENOTFOUND =1,
SYNFIGTOOL_BORRED =2,
SYNFIGTOOL_HELP =3,
SYNFIGTOOL_FILENOTFOUND =1,
SYNFIGTOOL_BORRED =2,
SYNFIGTOOL_HELP =3,
- SYNFIGTOOL_UNKNOWNARGUMENT =4,
- SYNFIGTOOL_UNKNOWNERROR =5,
- SYNFIGTOOL_INVALIDTARGET =6,
- SYNFIGTOOL_RENDERFAILURE =7,
+ SYNFIGTOOL_UNKNOWNARGUMENT =4,
+ SYNFIGTOOL_UNKNOWNERROR =5,
+ SYNFIGTOOL_INVALIDTARGET =6,
+ SYNFIGTOOL_RENDERFAILURE =7,
SYNFIGTOOL_BLANK =8,
SYNFIGTOOL_BLANK =8,
- SYNFIGTOOL_BADVERSION =9
+ SYNFIGTOOL_BADVERSION =9,
+ SYNFIGTOOL_MISSINGARGUMENT =10
};
#ifndef VERSION
};
#ifndef VERSION
@@
-93,11
+96,11
@@
bool print_benchmarks=false;
class Progress : public synfig::ProgressCallback
{
const char *program;
class Progress : public synfig::ProgressCallback
{
const char *program;
-
+
public:
public:
-
+
Progress(const char *name):program(name) { }
Progress(const char *name):program(name) { }
-
+
virtual bool
task(const String &task)
{
virtual bool
task(const String &task)
{
@@
-120,7
+123,7
@@
public:
}
virtual bool
}
virtual bool
- amount_complete(int
current, int total
)
+ amount_complete(int
/*current*/, int /*total*/
)
{
return true;
}
{
return true;
}
@@
-129,16
+132,16
@@
public:
class RenderProgress : public synfig::ProgressCallback
{
string taskname;
class RenderProgress : public synfig::ProgressCallback
{
string taskname;
-
+
etl::clock clk;
int clk_scanline; // The scanline at which the clock was reset
etl::clock clk2;
etl::clock clk;
int clk_scanline; // The scanline at which the clock was reset
etl::clock clk2;
- float last_time;
+ float last_time;
public:
public:
-
- RenderProgress():clk_scanline(0) { }
-
+
+ RenderProgress():clk_scanline(0)
, last_time(0)
{ }
+
virtual bool
task(const String &thetask)
{
virtual bool
task(const String &thetask)
{
@@
-176,7
+179,7
@@
public:
if(clk2()<0.2)
return true;
clk2.reset();
if(clk2()<0.2)
return true;
clk2.reset();
-
+
if(scanline)
seconds=(int)time+1;
else
if(scanline)
seconds=(int)time+1;
else
@@
-185,7
+188,7
@@
public:
clk.reset();
clk_scanline=scanline;
}
clk.reset();
clk_scanline=scanline;
}
-
+
if(seconds<0)
{
clk.reset();
if(seconds<0)
{
clk.reset();
@@
-200,7
+203,7
@@
public:
days++,hours-=24;
while(days>=7)
weeks++,days-=7;
days++,hours-=24;
while(days>=7)
weeks++,days-=7;
-
+
cerr<<taskname<<": "<<_("Line")<<" "<<scanline<<_(" of ")<<h<<" -- ";
//cerr<<time/(h-clk_scanline)<<" ";
/*
cerr<<taskname<<": "<<_("Line")<<" "<<scanline<<_(" of ")<<h<<" -- ";
//cerr<<time/(h-clk_scanline)<<" ";
/*
@@
-211,9
+214,9
@@
public:
{
//cerr<<"reset"<<endl;
clk.reset();
{
//cerr<<"reset"<<endl;
clk.reset();
- clk_scanline=scanline;
+ clk_scanline=scanline;
}
}
-
+
if(weeks)
cerr<<weeks<<"w ";
if(days)
if(weeks)
cerr<<weeks<<"w ";
if(days)
@@
-224,7
+227,7
@@
public:
cerr<<minutes<<"m ";
if(seconds)
cerr<<seconds<<"s ";
cerr<<minutes<<"m ";
if(seconds)
cerr<<seconds<<"s ";
-
+
cerr<<" \r";
}
else
cerr<<" \r";
}
else
@@
-237,13
+240,13
@@
struct Job
{
String filename;
String outfilename;
{
String filename;
String outfilename;
-
+
RendDesc desc;
Canvas::Handle root;
Canvas::Handle canvas;
Target::Handle target;
RendDesc desc;
Canvas::Handle root;
Canvas::Handle canvas;
Target::Handle target;
-
+
int quality;
bool sifout;
};
int quality;
bool sifout;
};
@@
-293,7
+296,7
@@
void display_help(int amount)
cerr<<strprintf(" %s %s %s",flag, arg, spaces+strlen(arg)+strlen(flag)+1)+description<<endl;
else
cerr<<strprintf(" %s %s",flag,spaces+strlen(flag))+description<<endl;
cerr<<strprintf(" %s %s %s",flag, arg, spaces+strlen(arg)+strlen(flag)+1)+description<<endl;
else
cerr<<strprintf(" %s %s",flag,spaces+strlen(flag))+description<<endl;
-
+
}
};
cerr<<_("syntax: ")<<progname<<" [DEFAULT OPTIONS] ([SIF FILE] [SPECIFIC OPTIONS])..."<<endl;
}
};
cerr<<_("syntax: ")<<progname<<" [DEFAULT OPTIONS] ([SIF FILE] [SPECIFIC OPTIONS])..."<<endl;
@@
-346,7
+349,7
@@
void display_help(int amount)
int process_global_flags(arg_list_t &arg_list)
{
arg_list_t::iterator iter, next;
int process_global_flags(arg_list_t &arg_list)
{
arg_list_t::iterator iter, next;
-
+
for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
{
if(*iter == "--")
for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
{
if(*iter == "--")
@@
-357,14
+360,14
@@
int process_global_flags(arg_list_t &arg_list)
signal_test();
return SYNFIGTOOL_HELP;
}
signal_test();
return SYNFIGTOOL_HELP;
}
-
+
if(*iter == "--guid-test")
{
guid_test();
return SYNFIGTOOL_HELP;
}
if(*iter == "--guid-test")
{
guid_test();
return SYNFIGTOOL_HELP;
}
-
+
if(*iter == "--help")
{
display_help(1);
if(*iter == "--help")
{
display_help(1);
@@
-444,7
+447,7
@@
int process_global_flags(arg_list_t &arg_list)
synfig::Target::Book::iterator iter=synfig::Target::book().begin();
for(;iter!=synfig::Target::book().end();iter++)
cout<<iter->first<<endl;
synfig::Target::Book::iterator iter=synfig::Target::book().begin();
for(;iter!=synfig::Target::book().end();iter++)
cout<<iter->first<<endl;
-
+
return SYNFIGTOOL_HELP;
}
return SYNFIGTOOL_HELP;
}
@@
-455,7
+458,7
@@
int process_global_flags(arg_list_t &arg_list)
synfig::LinkableValueNode::Book::iterator iter=synfig::LinkableValueNode::book().begin();
for(;iter!=synfig::LinkableValueNode::book().end();iter++)
cout<<iter->first<<endl;
synfig::LinkableValueNode::Book::iterator iter=synfig::LinkableValueNode::book().begin();
for(;iter!=synfig::LinkableValueNode::book().end();iter++)
cout<<iter->first<<endl;
-
+
return SYNFIGTOOL_HELP;
}
return SYNFIGTOOL_HELP;
}
@@
-466,16
+469,16
@@
int process_global_flags(arg_list_t &arg_list)
synfig::Importer::Book::iterator iter=synfig::Importer::book().begin();
for(;iter!=synfig::Importer::book().end();iter++)
cout<<iter->first<<endl;
synfig::Importer::Book::iterator iter=synfig::Importer::book().begin();
for(;iter!=synfig::Importer::book().end();iter++)
cout<<iter->first<<endl;
-
+
return SYNFIGTOOL_HELP;
}
if(*iter == "--version")
{
cerr<<PACKAGE<<" "<<VERSION<<endl;
return SYNFIGTOOL_HELP;
}
if(*iter == "--version")
{
cerr<<PACKAGE<<" "<<VERSION<<endl;
-
+
arg_list.erase(iter);
arg_list.erase(iter);
-
+
return SYNFIGTOOL_HELP;
}
return SYNFIGTOOL_HELP;
}
@@
-484,25
+487,23
@@
int process_global_flags(arg_list_t &arg_list)
cerr<<PACKAGE<<" "<<VERSION<<endl;
cout<<SYNFIG_COPYRIGHT<<endl<<endl;
cerr<<"\
cerr<<PACKAGE<<" "<<VERSION<<endl;
cout<<SYNFIG_COPYRIGHT<<endl<<endl;
cerr<<"\
-** This software and associated documentation\n\
-** are CONFIDENTIAL and PROPRIETARY property of\n\
-** the above-mentioned copyright holder.\n\
+** This package is free software; you can redistribute it and/or\n\
+** modify it under the terms of the GNU General Public License as\n\
+** published by the Free Software Foundation; either version 2 of\n\
+** the License, or (at your option) any later version.\n\
**\n\
**\n\
-** You may not use, copy, print, publish, or in\n\
-** any other way distribute or exploit this software\n\
-** without a prior written agreement with the\n\
-** copyright holder. " << endl << endl;
+** " << endl << endl;
arg_list.erase(iter);
arg_list.erase(iter);
-
+
return SYNFIGTOOL_HELP;
}
if(*iter == "-v")
{
verbosity++;
return SYNFIGTOOL_HELP;
}
if(*iter == "-v")
{
verbosity++;
-
+
arg_list.erase(iter);
arg_list.erase(iter);
-
+
continue;
}
continue;
}
@@
-523,14
+524,14
@@
int process_global_flags(arg_list_t &arg_list)
continue;
}
}
continue;
}
}
-
+
return SYNFIGTOOL_OK;
}
int extract_arg_cluster(arg_list_t &arg_list,arg_list_t &cluster)
{
arg_list_t::iterator iter, next;
return SYNFIGTOOL_OK;
}
int extract_arg_cluster(arg_list_t &arg_list,arg_list_t &cluster)
{
arg_list_t::iterator iter, next;
-
+
for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
{
if(*iter->begin() != '-')
for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
{
if(*iter->begin() != '-')
@@
-566,12
+567,16
@@
int extract_arg_cluster(arg_list_t &arg_list,arg_list_t &cluster)
cluster.push_back(*iter);
arg_list.erase(iter);
iter=next++;
cluster.push_back(*iter);
arg_list.erase(iter);
iter=next++;
+ if (iter==arg_list.end()) {
+ error("The `%s' flag requires a value. Use --help for a list of options.", cluster.back().c_str());
+ return SYNFIGTOOL_MISSINGARGUMENT;
+ }
}
}
-
+
cluster.push_back(*iter);
arg_list.erase(iter);
}
cluster.push_back(*iter);
arg_list.erase(iter);
}
-
+
return SYNFIGTOOL_OK;
}
return SYNFIGTOOL_OK;
}
@@
-589,14
+594,14
@@
int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc)
w=atoi(iter->c_str());
arg_list.erase(iter);
}
w=atoi(iter->c_str());
arg_list.erase(iter);
}
- if(*iter=="-h")
+
else
if(*iter=="-h")
{
arg_list.erase(iter);
iter=next++;
h=atoi(iter->c_str());
arg_list.erase(iter);
}
{
arg_list.erase(iter);
iter=next++;
h=atoi(iter->c_str());
arg_list.erase(iter);
}
- if(*iter=="-a")
+
else
if(*iter=="-a")
{
int a;
arg_list.erase(iter);
{
int a;
arg_list.erase(iter);
@@
-606,7
+611,7
@@
int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc)
VERBOSE_OUT(1)<<strprintf(_("Antialiasing set to %d, (%d samples per pixel)"),a,a*a)<<endl;
arg_list.erase(iter);
}
VERBOSE_OUT(1)<<strprintf(_("Antialiasing set to %d, (%d samples per pixel)"),a,a*a)<<endl;
arg_list.erase(iter);
}
- if(*iter=="-s")
+
else
if(*iter=="-s")
{
arg_list.erase(iter);
iter=next++;
{
arg_list.erase(iter);
iter=next++;
@@
-614,7
+619,7
@@
int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc)
VERBOSE_OUT(1)<<strprintf(_("Span set to %d units"),span)<<endl;
arg_list.erase(iter);
}
VERBOSE_OUT(1)<<strprintf(_("Span set to %d units"),span)<<endl;
arg_list.erase(iter);
}
- if(*iter=="--fps")
+
else
if(*iter=="--fps")
{
arg_list.erase(iter);
iter=next++;
{
arg_list.erase(iter);
iter=next++;
@@
-623,7
+628,7
@@
int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc)
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Frame rate set to %d frames per second"),fps)<<endl;
}
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Frame rate set to %d frames per second"),fps)<<endl;
}
- if(*iter=="--dpi")
+
else
if(*iter=="--dpi")
{
arg_list.erase(iter);
iter=next++;
{
arg_list.erase(iter);
iter=next++;
@@
-633,7
+638,7
@@
int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc)
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Physical resolution set to %f dpi"),dpi)<<endl;
}
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Physical resolution set to %f dpi"),dpi)<<endl;
}
- if(*iter=="--dpi-x")
+
else
if(*iter=="--dpi-x")
{
arg_list.erase(iter);
iter=next++;
{
arg_list.erase(iter);
iter=next++;
@@
-643,7
+648,7
@@
int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc)
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Physical X resolution set to %f dpi"),dpi)<<endl;
}
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Physical X resolution set to %f dpi"),dpi)<<endl;
}
- if(*iter=="--dpi-y")
+
else
if(*iter=="--dpi-y")
{
arg_list.erase(iter);
iter=next++;
{
arg_list.erase(iter);
iter=next++;
@@
-653,21
+658,21
@@
int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc)
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Physical Y resolution set to %f dpi"),dpi)<<endl;
}
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Physical Y resolution set to %f dpi"),dpi)<<endl;
}
- if(*iter=="--start-time" || *iter=="--begin-time")
+
else
if(*iter=="--start-time" || *iter=="--begin-time")
{
arg_list.erase(iter);
iter=next++;
desc.set_time_start(Time(*iter,desc.get_frame_rate()));
arg_list.erase(iter);
}
{
arg_list.erase(iter);
iter=next++;
desc.set_time_start(Time(*iter,desc.get_frame_rate()));
arg_list.erase(iter);
}
- if(*iter=="--end-time")
+
else
if(*iter=="--end-time")
{
arg_list.erase(iter);
iter=next++;
desc.set_time_end(Time(*iter,desc.get_frame_rate()));
arg_list.erase(iter);
}
{
arg_list.erase(iter);
iter=next++;
desc.set_time_end(Time(*iter,desc.get_frame_rate()));
arg_list.erase(iter);
}
- if(*iter=="--time")
+
else
if(*iter=="--time")
{
arg_list.erase(iter);
iter=next++;
{
arg_list.erase(iter);
iter=next++;
@@
-675,13
+680,13
@@
int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc)
VERBOSE_OUT(1)<<_("Rendering frame at ")<<desc.get_time_start().get_string(desc.get_frame_rate())<<endl;
arg_list.erase(iter);
}
VERBOSE_OUT(1)<<_("Rendering frame at ")<<desc.get_time_start().get_string(desc.get_frame_rate())<<endl;
arg_list.erase(iter);
}
- if(*iter=="-g")
+
else
if(*iter=="-g")
{
synfig::warning("Gamma argument is currently ignored");
{
synfig::warning("Gamma argument is currently ignored");
-
//
arg_list.erase(iter);
-
//
iter=next++;
+ arg_list.erase(iter);
+ iter=next++;
//desc.set_gamma(Gamma(atof(iter->c_str())));
//desc.set_gamma(Gamma(atof(iter->c_str())));
-
//
arg_list.erase(iter);
+ arg_list.erase(iter);
}
}
if(w&&h)
}
}
if(w&&h)
@@
-721,7
+726,7
@@
int extract_quality(arg_list_t &arg_list,int &quality)
arg_list.erase(iter);
}
}
arg_list.erase(iter);
}
}
-
+
return SYNFIGTOOL_OK;
}
return SYNFIGTOOL_OK;
}
@@
-739,7
+744,7
@@
int extract_threads(arg_list_t &arg_list,int &threads)
arg_list.erase(iter);
}
}
arg_list.erase(iter);
}
}
-
+
return SYNFIGTOOL_OK;
}
return SYNFIGTOOL_OK;
}
@@
-747,7
+752,7
@@
int extract_target(arg_list_t &arg_list,string &type)
{
arg_list_t::iterator iter, next;
type.clear();
{
arg_list_t::iterator iter, next;
type.clear();
-
+
for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
{
if(*iter=="-t")
for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
{
if(*iter=="-t")
@@
-766,7
+771,7
@@
int extract_append(arg_list_t &arg_list,string &filename)
{
arg_list_t::iterator iter, next;
filename.clear();
{
arg_list_t::iterator iter, next;
filename.clear();
-
+
for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
{
if(*iter=="--append")
for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
{
if(*iter=="--append")
@@
-786,7
+791,7
@@
int extract_outfile(arg_list_t &arg_list,string &outfile)
arg_list_t::iterator iter, next;
int ret=SYNFIGTOOL_FILENOTFOUND;
outfile.clear();
arg_list_t::iterator iter, next;
int ret=SYNFIGTOOL_FILENOTFOUND;
outfile.clear();
-
+
for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
{
if(*iter=="-o")
for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
{
if(*iter=="-o")
@@
-806,7
+811,7
@@
int extract_canvasid(arg_list_t &arg_list,string &canvasid)
{
arg_list_t::iterator iter, next;
//canvasid.clear();
{
arg_list_t::iterator iter, next;
//canvasid.clear();
-
+
for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
{
if(*iter=="-c")
for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
{
if(*iter=="-c")
@@
-830,10
+835,10
@@
int main(int argc, char *argv[])
int i;
arg_list_t arg_list;
job_list_t job_list;
int i;
arg_list_t arg_list;
job_list_t job_list;
-
+
progname=argv[0];
Progress p(argv[0]);
progname=argv[0];
Progress p(argv[0]);
-
+
if(!SYNFIG_CHECK_VERSION())
{
cerr<<_("FATAL: Synfig Version Mismatch")<<endl;
if(!SYNFIG_CHECK_VERSION())
{
cerr<<_("FATAL: Synfig Version Mismatch")<<endl;
@@
-847,31
+852,34
@@
int main(int argc, char *argv[])
for(i=1;i<argc;i++)
arg_list.push_back(argv[i]);
for(i=1;i<argc;i++)
arg_list.push_back(argv[i]);
-
+
if((i=process_global_flags(arg_list)))
return i;
VERBOSE_OUT(1)<<_("verbosity set to ")<<verbosity<<endl;
synfig::Main synfig_main(dirname(progname),&p);
if((i=process_global_flags(arg_list)))
return i;
VERBOSE_OUT(1)<<_("verbosity set to ")<<verbosity<<endl;
synfig::Main synfig_main(dirname(progname),&p);
-
+
{
arg_list_t defaults, imageargs;
{
arg_list_t defaults, imageargs;
-
+ int ret;
+
// Grab the defaults before the first file
// Grab the defaults before the first file
- extract_arg_cluster(arg_list,defaults);
-
+ if ((ret = extract_arg_cluster(arg_list,defaults)) != SYNFIGTOOL_OK)
+ return ret;
+
while(arg_list.size())
{
string target_name;
job_list.push_front(Job());
int threads=0;
while(arg_list.size())
{
string target_name;
job_list.push_front(Job());
int threads=0;
-
+
imageargs=defaults;
job_list.front().filename=arg_list.front();
arg_list.pop_front();
imageargs=defaults;
job_list.front().filename=arg_list.front();
arg_list.pop_front();
- extract_arg_cluster(arg_list,imageargs);
-
+ if ((ret = extract_arg_cluster(arg_list,imageargs)) != SYNFIGTOOL_OK)
+ return ret;
+
// Open the composition
{
job_list.front().root=open_canvas(job_list.front().filename);
// Open the composition
{
job_list.front().root=open_canvas(job_list.front().filename);
@@
-885,7
+893,7
@@
int main(int argc, char *argv[])
}
job_list.front().root->set_time(0);
}
job_list.front().root->set_time(0);
-
+
string canvasid;
extract_canvasid(imageargs,canvasid);
if(!canvasid.empty())
string canvasid;
extract_canvasid(imageargs,canvasid);
if(!canvasid.empty())
@@
-900,7
+908,7
@@
int main(int argc, char *argv[])
cerr<<_("Throwing out job...")<<endl;
job_list.pop_front();
continue;
cerr<<_("Throwing out job...")<<endl;
job_list.pop_front();
continue;
-
+
}
catch(Exception::BadLinkName)
{
}
catch(Exception::BadLinkName)
{
@@
-908,12
+916,12
@@
int main(int argc, char *argv[])
cerr<<_("Throwing out job...")<<endl;
job_list.pop_front();
continue;
cerr<<_("Throwing out job...")<<endl;
job_list.pop_front();
continue;
-
+
}
}
else
job_list.front().canvas=job_list.front().root;
}
}
else
job_list.front().canvas=job_list.front().root;
-
+
extract_RendDesc(imageargs,job_list.front().canvas->rend_desc());
extract_target(imageargs,target_name);
extract_threads(imageargs,threads);
extract_RendDesc(imageargs,job_list.front().canvas->rend_desc());
extract_target(imageargs,target_name);
extract_threads(imageargs,threads);
@@
-942,25
+950,20
@@
int main(int argc, char *argv[])
VERBOSE_OUT(2)<<_("Appended contents of ")<<composite_file<<endl;
}
}while(false);
VERBOSE_OUT(2)<<_("Appended contents of ")<<composite_file<<endl;
}
}while(false);
-
+
VERBOSE_OUT(4)<<_("Attempting to determine target/outfile...")<<endl;
VERBOSE_OUT(4)<<_("Attempting to determine target/outfile...")<<endl;
-
+
// If the target type is not yet defined,
// try to figure it out from the outfile.
if(target_name.empty() && !job_list.front().outfilename.empty())
// If the target type is not yet defined,
// try to figure it out from the outfile.
if(target_name.empty() && !job_list.front().outfilename.empty())
- try
{
VERBOSE_OUT(3)<<_("Target name undefined, attempting to figure it out")<<endl;
{
VERBOSE_OUT(3)<<_("Target name undefined, attempting to figure it out")<<endl;
- string ext=
string(find(job_list.front().outfilename.begin(),job_list.front().outfilename.end(),'.')+1,job_list.front().outfilename.end()
);
+ string ext=
job_list.front().outfilename.substr(job_list.front().outfilename.rfind('.')+1
);
if(Target::ext_book().count(ext))
target_name=Target::ext_book()[ext];
else
target_name=ext;
}
if(Target::ext_book().count(ext))
target_name=Target::ext_book()[ext];
else
target_name=ext;
}
- catch(std::length_error)
- {
- synfig::warning("Length error caught when attempting to figure out target name");
- }
// If the target type is STILL not yet defined, then
// set it to a some sort of default
// If the target type is STILL not yet defined, then
// set it to a some sort of default
@@
-986,10
+989,10
@@
int main(int argc, char *argv[])
VERBOSE_OUT(4)<<"target_name="<<target_name<<endl;
VERBOSE_OUT(4)<<"outfile_name="<<job_list.front().outfilename<<endl;
VERBOSE_OUT(4)<<"target_name="<<target_name<<endl;
VERBOSE_OUT(4)<<"outfile_name="<<job_list.front().outfilename<<endl;
-
+
VERBOSE_OUT(4)<<_("Creating the target...")<<endl;
job_list.front().target=synfig::Target::create(target_name,job_list.front().outfilename);
VERBOSE_OUT(4)<<_("Creating the target...")<<endl;
job_list.front().target=synfig::Target::create(target_name,job_list.front().outfilename);
-
+
if(target_name=="sif")
{
job_list.front().sifout=true;
if(target_name=="sif")
{
job_list.front().sifout=true;
@@
-1011,16
+1014,16
@@
int main(int argc, char *argv[])
{
VERBOSE_OUT(4)<<_("Setting the canvas on the target...")<<endl;
job_list.front().target->set_canvas(job_list.front().canvas);
{
VERBOSE_OUT(4)<<_("Setting the canvas on the target...")<<endl;
job_list.front().target->set_canvas(job_list.front().canvas);
- VERBOSE_OUT(4)<<_("Setting the quality of the target...")<<endl;
+ VERBOSE_OUT(4)<<_("Setting the quality of the target...")<<endl;
job_list.front().target->set_quality(job_list.front().quality);
}
job_list.front().target->set_quality(job_list.front().quality);
}
-
+
// Set the threads for the target
if(job_list.front().target && Target_Scanline::Handle::cast_dynamic(job_list.front().target))
{
Target_Scanline::Handle::cast_dynamic(job_list.front().target)->set_threads(threads);
}
// Set the threads for the target
if(job_list.front().target && Target_Scanline::Handle::cast_dynamic(job_list.front().target))
{
Target_Scanline::Handle::cast_dynamic(job_list.front().target)->set_threads(threads);
}
-
+
if(imageargs.size())
{
cerr<<_("Unidentified arguments for ")<<job_list.front().filename<<": ";
if(imageargs.size())
{
cerr<<_("Unidentified arguments for ")<<job_list.front().filename<<": ";
@@
-1035,7
+1038,7
@@
int main(int argc, char *argv[])
//getline(cin,bleh);
}
}
//getline(cin,bleh);
}
}
-
+
if(arg_list.size())
{
cerr<<_("Unidentified arguments:");
if(arg_list.size())
{
cerr<<_("Unidentified arguments:");
@@
-1044,13
+1047,13
@@
int main(int argc, char *argv[])
cerr<<endl;
return SYNFIGTOOL_UNKNOWNARGUMENT;
}
cerr<<endl;
return SYNFIGTOOL_UNKNOWNARGUMENT;
}
-
+
if(!job_list.size())
{
cerr<<_("Nothing to do!")<<endl;
return SYNFIGTOOL_BORRED;
}
if(!job_list.size())
{
cerr<<_("Nothing to do!")<<endl;
return SYNFIGTOOL_BORRED;
}
-
+
for(;job_list.size();job_list.pop_front())
{
VERBOSE_OUT(3)<<job_list.front().filename<<" -- "<<endl<<'\t'<<
for(;job_list.size();job_list.pop_front())
{
VERBOSE_OUT(3)<<job_list.front().filename<<" -- "<<endl<<'\t'<<
@@
-1067,7
+1070,7
@@
int main(int argc, char *argv[])
job_list.front().desc.get_br()[0],job_list.front().desc.get_br()[1],
job_list.front().desc.get_focus()[0],job_list.front().desc.get_focus()[1]
)<<endl;
job_list.front().desc.get_br()[0],job_list.front().desc.get_br()[1],
job_list.front().desc.get_focus()[0],job_list.front().desc.get_focus()[1]
)<<endl;
-
+
RenderProgress p;
p.task(job_list.front().filename+" ==> "+job_list.front().outfilename);
if(!job_list.front().sifout)
RenderProgress p;
p.task(job_list.front().filename+" ==> "+job_list.front().outfilename);
if(!job_list.front().sifout)
@@
-1095,10
+1098,10
@@
int main(int argc, char *argv[])
}
}
}
}
}
}
-
+
job_list.clear();
job_list.clear();
-
+
VERBOSE_OUT(1)<<_("Done.")<<endl;
VERBOSE_OUT(1)<<_("Done.")<<endl;
-
+
return SYNFIGTOOL_OK;
}
return SYNFIGTOOL_OK;
}