-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
/*! \file listimporter.cpp
** \brief Template File
**
-** $Id: listimporter.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+** $Id$
**
** \legal
-** Copyright (c) 2002 Robert B. Quattlebaum Jr.
+** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
**
-** 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
*/
/* ========================================================================= */
using namespace std;
using namespace etl;
-using namespace sinfg;
+using namespace synfig;
/* === M A C R O S ========================================================= */
if(!stream)
{
- sinfg::error("Unable to open "+filename);
+ synfig::error("Unable to open "+filename);
return;
}
String line;
- String prefix=etl::dirname(filename)+ETL_DIRECTORY_SEPERATOR;
+ String prefix=etl::dirname(filename)+ETL_DIRECTORY_SEPARATOR;
while(!stream.eof())
{
getline(stream,line);
if(line.find(String("FPS "))==0)
{
fps=atof(String(line.begin()+4,line.end()).c_str());
- //sinfg::warning("FPS=%f",fps);
+ //synfig::warning("FPS=%f",fps);
if(!fps)
fps=15;
continue;
// DEBUGPOINT();
int frame=static_cast<int>(time*fps);
// DEBUGPOINT();
-
+
if(!filename_list.size())
{
if(cb)cb->error(_("No images in list"));
- else sinfg::error(_("No images in list"));
+ else synfig::error(_("No images in list"));
return false;
}
-
+
// DEBUGPOINT();
if(frame<0)frame=0;
if(frame>=(signed)filename_list.size())frame=filename_list.size()-1;
-
+
// DEBUGPOINT();
// See if that frame is cached
std::list<std::pair<int,Surface> >::iterator iter;
return static_cast<bool>(surface);
}
}
-
+
Importer::Handle importer(Importer::open(filename_list[frame]));
-
+
// DEBUGPOINT();
if(!importer)
{
if(cb)cb->error(_("Unable to open ")+filename_list[frame]);
- else sinfg::error(_("Unable to open ")+filename_list[frame]);
+ else synfig::error(_("Unable to open ")+filename_list[frame]);
return false;
}
-
+
// DEBUGPOINT();
if(!importer->get_frame(surface,0,cb))
{
if(cb)cb->error(_("Unable to get frame from ")+filename_list[frame]);
- else sinfg::error(_("Unable to get frame from ")+filename_list[frame]);
+ else synfig::error(_("Unable to get frame from ")+filename_list[frame]);
return false;
}
-
+
// DEBUGPOINT();
if(frame_cache.size()>=LIST_IMPORTER_CACHE_SIZE)
// DEBUGPOINT();
- frame_cache.push_back(std::pair<int,Surface>(frame,surface));
+ frame_cache.push_back(std::pair<int,Surface>(frame,surface));
// DEBUGPOINT();