use -r argument with JACK if realtime is not requested in engine dialog (also applied...
[ArdourMidi.git] / libs / rubberband / src / RubberBandStretcher.cpp
blob7e249c66333b7192bfd1eb0afc8110ed1950f4b6
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-2008 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 #include "StretcherImpl.h"
17 namespace RubberBand {
20 RubberBandStretcher::RubberBandStretcher(size_t sampleRate,
21 size_t channels,
22 Options options,
23 double initialTimeRatio,
24 double initialPitchScale) :
25 m_d(new Impl(sampleRate, channels, options,
26 initialTimeRatio, initialPitchScale))
30 RubberBandStretcher::~RubberBandStretcher()
32 delete m_d;
35 void
36 RubberBandStretcher::reset()
38 m_d->reset();
41 void
42 RubberBandStretcher::setTimeRatio(double ratio)
44 m_d->setTimeRatio(ratio);
47 void
48 RubberBandStretcher::setPitchScale(double scale)
50 m_d->setPitchScale(scale);
53 double
54 RubberBandStretcher::getTimeRatio() const
56 return m_d->getTimeRatio();
59 double
60 RubberBandStretcher::getPitchScale() const
62 return m_d->getPitchScale();
65 size_t
66 RubberBandStretcher::getLatency() const
68 return m_d->getLatency();
71 void
72 RubberBandStretcher::setTransientsOption(Options options)
74 m_d->setTransientsOption(options);
77 void
78 RubberBandStretcher::setPhaseOption(Options options)
80 m_d->setPhaseOption(options);
83 void
84 RubberBandStretcher::setFormantOption(Options options)
86 m_d->setFormantOption(options);
89 void
90 RubberBandStretcher::setPitchOption(Options options)
92 m_d->setPitchOption(options);
95 void
96 RubberBandStretcher::setExpectedInputDuration(size_t samples)
98 m_d->setExpectedInputDuration(samples);
101 void
102 RubberBandStretcher::setMaxProcessSize(size_t samples)
104 m_d->setMaxProcessSize(samples);
107 size_t
108 RubberBandStretcher::getSamplesRequired() const
110 return m_d->getSamplesRequired();
113 void
114 RubberBandStretcher::study(const float *const *input, size_t samples,
115 bool final)
117 m_d->study(input, samples, final);
120 void
121 RubberBandStretcher::process(const float *const *input, size_t samples,
122 bool final)
124 m_d->process(input, samples, final);
128 RubberBandStretcher::available() const
130 return m_d->available();
133 size_t
134 RubberBandStretcher::retrieve(float *const *output, size_t samples) const
136 return m_d->retrieve(output, samples);
139 float
140 RubberBandStretcher::getFrequencyCutoff(int n) const
142 return m_d->getFrequencyCutoff(n);
145 void
146 RubberBandStretcher::setFrequencyCutoff(int n, float f)
148 m_d->setFrequencyCutoff(n, f);
151 size_t
152 RubberBandStretcher::getInputIncrement() const
154 return m_d->getInputIncrement();
157 std::vector<int>
158 RubberBandStretcher::getOutputIncrements() const
160 return m_d->getOutputIncrements();
163 std::vector<float>
164 RubberBandStretcher::getPhaseResetCurve() const
166 return m_d->getPhaseResetCurve();
169 std::vector<int>
170 RubberBandStretcher::getExactTimePoints() const
172 return m_d->getExactTimePoints();
175 size_t
176 RubberBandStretcher::getChannelCount() const
178 return m_d->getChannelCount();
181 void
182 RubberBandStretcher::calculateStretch()
184 m_d->calculateStretch();
187 void
188 RubberBandStretcher::setDebugLevel(int level)
190 m_d->setDebugLevel(level);
193 void
194 RubberBandStretcher::setDefaultDebugLevel(int level)
196 Impl::setDefaultDebugLevel(level);