summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/interpolation.h
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2009-06-23 09:50:02 +0000
committerHans Baier <hansfbaier@googlemail.com>2009-06-23 09:50:02 +0000
commitf42f577bedbffcd2465341e033afac0a0326a491 (patch)
tree3499d135da2d870010a8231389fb040a22c02218 /libs/ardour/ardour/interpolation.h
parentdef335e427f46513436884bf81d10caf96d7c482 (diff)
Interpolation: First working but buggy version using libsamplerate
git-svn-id: svn://localhost/ardour2/branches/3.0@5255 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/interpolation.h')
-rw-r--r--libs/ardour/ardour/interpolation.h37
1 files changed, 21 insertions, 16 deletions
diff --git a/libs/ardour/ardour/interpolation.h b/libs/ardour/ardour/interpolation.h
index fc75451707..d0ba3c48bc 100644
--- a/libs/ardour/ardour/interpolation.h
+++ b/libs/ardour/ardour/interpolation.h
@@ -1,4 +1,6 @@
#include <math.h>
+#include <samplerate.h>
+
#include "ardour/types.h"
#ifndef __interpolation_h__
@@ -8,26 +10,29 @@ namespace ARDOUR {
class Interpolation {
protected:
- double _speed, _target_speed;
-
+ double _speed;
+
+ SRC_STATE* state;
+ std::vector<SRC_DATA> data;
+
+ int error;
+
+ void reset_state ();
+
public:
- Interpolation () : _speed(0.0L) {}
+ Interpolation ();
+ ~Interpolation ();
- 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; }
+ void set_speed (double new_speed);
+ void set_target_speed (double new_speed) {}
+ double speed () const { return _speed; }
+
+ void add_channel_to (int input_buffer_size, int output_buffer_size);
+ void remove_channel_from ();
- 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);
+ nframes_t interpolate (int channel, nframes_t nframes, Sample* input, Sample* output);
};
} // namespace ARDOUR
-#endif
-
+#endif \ No newline at end of file