summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/interpolation.h
blob: 06c7ddebe00d20dfcf0d95f67a206ce85e129c94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <math.h>
#include "ardour/types.h"

#ifndef __interpolation_h__
#define __interpolation_h__

namespace ARDOUR {

class Interpolation {
protected:
	double   _speed, _target_speed;
    	    
public:
        Interpolation () : _speed(0.0L) {}
    
        void set_speed (double new_speed)          { _speed = new_speed; }
        void set_target_speed (double new_speed)   { _target_speed = new_speed; }

        double target_speed()          const { return _target_speed; }
        double speed()                 const { return _speed; }
 
        virtual nframes_t interpolate (nframes_t nframes, Sample* input, Sample* output) = 0;
};

class LinearInterpolation : public Interpolation {
public:
        nframes_t interpolate (nframes_t nframes, Sample* input, Sample* output);
};

} // namespace ARDOUR

#endif