/*! \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-2005 Robert B. Quattlebaum Jr., Adrian Bentley
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);
ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb)
{
// DEBUGPOINT();
- int frame=static_cast<int>(time*fps);
+ int frame=round_to_int(time*fps);
// DEBUGPOINT();
-
+
if(!filename_list.size())
{
if(cb)cb->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;
+ std::list<std::pair<String,Surface> >::iterator iter;
for(iter=frame_cache.begin();iter!=frame_cache.end();++iter)
{
- if(iter->first==frame)
+ if(iter->first==filename_list[frame])
{
// DEBUGPOINT();
surface.mirror(iter->second);
return static_cast<bool>(surface);
}
}
-
+
Importer::Handle importer(Importer::open(filename_list[frame]));
-
+
// DEBUGPOINT();
if(!importer)
else synfig::error(_("Unable to open ")+filename_list[frame]);
return false;
}
-
+
// DEBUGPOINT();
if(!importer->get_frame(surface,0,cb))
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<String,Surface>(filename_list[frame],surface));
// DEBUGPOINT();