Fix some compilation warnings
[ardour.git] / libs / rubberband / src / Resampler.h
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4     Rubber Band
5     An audio time-stretching and pitch-shifting library.
6     Copyright 2007-2008 Chris Cannam.
7     
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.
13 */
14
15 #ifndef _RUBBERBAND_RESAMPLER_H_
16 #define _RUBBERBAND_RESAMPLER_H_
17
18 #include <sys/types.h>
19
20 #include "sysutils.h"
21
22 namespace RubberBand {
23
24 class ResamplerImpl;
25
26 class Resampler
27 {
28 public:
29     enum Quality { Best, FastestTolerable, Fastest };
30     enum Exception { ImplementationError };
31
32     /**
33      * Construct a resampler with the given quality level and channel
34      * count.  maxBufferSize gives a bound on the maximum incount size
35      * that may be passed to the resample function before the
36      * resampler needs to reallocate its internal buffers.
37      */
38     Resampler(Quality quality, int channels, int maxBufferSize = 0,
39               int debugLevel = 0);
40     ~Resampler();
41
42     int resample(const float *const R__ *const R__ in,
43                  float *const R__ *const R__ out,
44                  int incount,
45                  float ratio,
46                  bool final = false);
47
48     void reset();
49
50 protected:
51     ResamplerImpl *d;
52     int m_method;
53 };
54
55 }
56
57 #endif