1 /*
2     Resample - Resample
3 
4     Resample.h  - headers.
5     Copyright (C) 2008-2010 Josep Andreu
6     Author: Josep Andreu
7 
8 
9  This program is free software; you can redistribute it and/or modify
10  it under the terms of version 2 of the GNU General Public License
11  as published by the Free Software Foundation.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  GNU General Public License (version 2) for more details.
17 
18  You should have received a copy of the GNU General Public License
19  (version2)  along with this program; if not, write to the Free Software
20  Foundation,
21  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22 
23 */
24 
25 #ifndef RESAMPLE_H
26 #define RESAMPLE_H
27 
28 #include <samplerate.h>
29 #include "global.h"
30 
31 
32 
33 
34 class Resample
35 {
36 public:
37     Resample(int type);
38     /*
39     Types:
40               SRC_SINC_BEST_QUALITY       = 0,
41               SRC_SINC_MEDIUM_QUALITY     = 1,
42               SRC_SINC_FASTEST            = 2,
43               SRC_ZERO_ORDER_HOLD         = 3,
44               SRC_LINEAR                  = 4
45     */
46 
47     ~Resample();
48     void cleanup();
49     void out(float *inl, float *inr, float *outl, float *outr, int frames, double ratio);
50     void mono_out(float *inl, float *outl, int frames, double ratio, int o_frames);
51 
52     // ratio Equal to output_sample_rate / input_sample_rate.
53 
54 
55     SRC_DATA srcinfor;
56     SRC_DATA srcinfol;
57 
58 
59 private:
60 
61     int errorl,errorr;
62 
63 
64     SRC_STATE *statel;
65     SRC_STATE *stater;
66 
67 
68 };
69 
70 #endif
71