1 /*! ========================================================================
3 ** Image Layer_TimeLoop Layer Implementation
4 ** $Id: timeloop.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $
6 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
8 ** This package is free software; you can redistribute it and/or
9 ** modify it under the terms of the GNU General Public License as
10 ** published by the Free Software Foundation; either version 2 of
11 ** the License, or (at your option) any later version.
13 ** This package is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ** General Public License for more details.
18 ** === N O T E S ===========================================================
20 ** ========================================================================= */
22 /* === H E A D E R S ======================================================= */
32 #include <synfig/time.h>
33 #include <synfig/context.h>
34 #include <synfig/paramdesc.h>
35 #include <synfig/renddesc.h>
36 #include <synfig/value.h>
40 using namespace synfig;
44 /* === M A C R O S ========================================================= */
46 /* === G L O B A L S ======================================================= */
48 SYNFIG_LAYER_INIT(Layer_TimeLoop);
49 SYNFIG_LAYER_SET_NAME(Layer_TimeLoop,"timeloop");
50 SYNFIG_LAYER_SET_LOCAL_NAME(Layer_TimeLoop,_("TimeLoop"));
51 SYNFIG_LAYER_SET_CATEGORY(Layer_TimeLoop,_("Other"));
52 SYNFIG_LAYER_SET_VERSION(Layer_TimeLoop,"0.1");
53 SYNFIG_LAYER_SET_CVS_ID(Layer_TimeLoop,"$Id: timeloop.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $");
55 /* === P R O C E D U R E S ================================================= */
57 /* === M E T H O D S ======================================================= */
59 Layer_TimeLoop::Layer_TimeLoop()
65 Layer_TimeLoop::~Layer_TimeLoop()
70 Layer_TimeLoop::set_param(const String & param, const ValueBase &value)
74 return Layer::set_param(param,value);
78 Layer_TimeLoop::get_param(const String & param)const
85 return Layer::get_param(param);
89 Layer_TimeLoop::get_param_vocab()const
91 Layer::Vocab ret(Layer::get_param_vocab());
93 ret.push_back(ParamDesc("start_time")
94 .set_local_name(_("Start Time"))
97 ret.push_back(ParamDesc("end_time")
98 .set_local_name(_("End Time"))
105 Layer_TimeLoop::set_time(Context context, Time time)const
107 Real diff(end_time-start_time);
109 time-=int(Real(time-start_time)/diff)*diff+start_time;
110 context.set_time(time);
114 Layer_TimeLoop::get_color(Context context, const Point &pos)const
116 return context.get_color(pos);
120 Layer_TimeLoop::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
122 return context.accelerated_render(surface,quality,renddesc,cb);