This makes it clearer what kind of interpolation is used and allows
adding other types in the future.
-InterpolationAction::InterpolationAction(bool h):
- hermite(h),
+InterpolationAction::InterpolationAction(Mode m):
+ mode(m),
start_beat(0),
duration(0)
{ }
start_beat(0),
duration(0)
{ }
{
float t = (b-start_beat)/duration;
float dt = d/duration;
{
float t = (b-start_beat)/duration;
float dt = d/duration;
{
dt = t-dt;
t = (3-2*t)*t*t;
{
dt = t-dt;
t = (3-2*t)*t*t;
class InterpolationAction: public Action
{
protected:
class InterpolationAction: public Action
{
protected:
+ enum Mode
+ {
+ LINEAR,
+ HERMITE
+ };
+
+ Mode mode;
float start_beat;
float duration;
float start_beat;
float duration;
- InterpolationAction(bool = false);
+ InterpolationAction(Mode = LINEAR);
public:
virtual void start(float, float);
public:
virtual void start(float, float);
using namespace Msp;
ColorFadeAction::ColorFadeAction(const GL::Color &c):
using namespace Msp;
ColorFadeAction::ColorFadeAction(const GL::Color &c):
- InterpolationAction(true),
+ InterpolationAction(HERMITE),