fix up file renaming code a little bit
[ArdourMidi.git] / libs / rubberband / rubberband / TimeStretcher.h
blobbad916a75c42a1923d8e2af447bd30c6a73f9ca8
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
3 /*
4 Rubber Band
5 An audio time-stretching and pitch-shifting library.
6 Copyright 2007 Chris Cannam.
8 This program 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 the
11 License, or (at your option) any later version. See the file
12 COPYING included with this distribution for more information.
15 #ifndef _RUBBERBAND_TIMESTRETCHER_H_
16 #define _RUBBERBAND_TIMESTRETCHER_H_
18 #include <sys/types.h>
20 namespace RubberBand
23 /**
24 * Base class for time stretchers. RubberBand currently provides only
25 * a single subclass implementation.
27 * @see RubberBandStretcher
29 class TimeStretcher
31 public:
32 TimeStretcher(size_t sampleRate, size_t channels) :
33 m_sampleRate(sampleRate),
34 m_channels(channels)
35 { }
36 virtual ~TimeStretcher()
37 { }
39 virtual void reset() = 0;
40 virtual void setTimeRatio(double ratio) = 0;
41 virtual void setPitchScale(double scale) = 0;
42 virtual size_t getLatency() const = 0;
44 virtual void study(const float *const *input, size_t samples, bool final) = 0;
45 virtual size_t getSamplesRequired() const = 0;
46 virtual void process(const float *const *input, size_t samples, bool final) = 0;
47 virtual int available() const = 0;
48 virtual size_t retrieve(float *const *output, size_t samples) const = 0;
50 protected:
51 size_t m_sampleRate;
52 size_t m_channels;
57 #endif