1 /* === S Y N F I G ========================================================= */
3 ** \brief Image Layer_TimeLoop Layer Implementation
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.
19 ** === N O T E S ===========================================================
21 ** ========================================================================= */
23 /* === H E A D E R S ======================================================= */
33 #include <synfig/time.h>
34 #include <synfig/context.h>
35 #include <synfig/paramdesc.h>
36 #include <synfig/renddesc.h>
37 #include <synfig/value.h>
41 using namespace synfig;
45 /* === M A C R O S ========================================================= */
47 /* === G L O B A L S ======================================================= */
49 SYNFIG_LAYER_INIT(Layer_TimeLoop);
50 SYNFIG_LAYER_SET_NAME(Layer_TimeLoop,"timeloop");
51 SYNFIG_LAYER_SET_LOCAL_NAME(Layer_TimeLoop,_("TimeLoop"));
52 SYNFIG_LAYER_SET_CATEGORY(Layer_TimeLoop,_("Other"));
53 SYNFIG_LAYER_SET_VERSION(Layer_TimeLoop,"0.1");
54 SYNFIG_LAYER_SET_CVS_ID(Layer_TimeLoop,"$Id: timeloop.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $");
56 /* === P R O C E D U R E S ================================================= */
58 /* === M E T H O D S ======================================================= */
60 Layer_TimeLoop::Layer_TimeLoop()
66 Layer_TimeLoop::~Layer_TimeLoop()
71 Layer_TimeLoop::set_param(const String & param, const ValueBase &value)
75 return Layer::set_param(param,value);
79 Layer_TimeLoop::get_param(const String & param)const
86 return Layer::get_param(param);
90 Layer_TimeLoop::get_param_vocab()const
92 Layer::Vocab ret(Layer::get_param_vocab());
94 ret.push_back(ParamDesc("start_time")
95 .set_local_name(_("Start Time"))
98 ret.push_back(ParamDesc("end_time")
99 .set_local_name(_("End Time"))
106 Layer_TimeLoop::set_time(Context context, Time time)const
108 Real diff(end_time-start_time);
110 time-=int(Real(time-start_time)/diff)*diff+start_time;
111 context.set_time(time);
115 Layer_TimeLoop::get_color(Context context, const Point &pos)const
117 return context.get_color(pos);
121 Layer_TimeLoop::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
123 return context.accelerated_render(surface,quality,renddesc,cb);