1 /* 2 * Copyright 2003 Marcus Overhagen 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _RESAMPLER_H 6 #define _RESAMPLER_H 7 8 9 #include <SupportDefs.h> 10 11 12 class Resampler { 13 public: 14 Resampler(uint32 sourceFormat, 15 uint32 destFormat); 16 17 status_t InitCheck() const; 18 19 void Resample(const void* src, int32 srcSampleOffset, 20 int32 srcSampleCount, void* dest, 21 int32 destSampleOffset, 22 int32 destSampleCount, float gain); 23 24 protected: 25 Resampler(); 26 void (*fFunc)(Resampler* object, const void* src, 27 int32 srcSampleOffset, int32 srcSampleCount, 28 void* dest, int32 destSampleOffset, 29 int32 destSampleCount, float gain); 30 }; 31 32 33 inline void 34 Resampler::Resample(const void *src, int32 srcSampleOffset, 35 int32 srcSampleCount, void *dest, int32 destSampleOffset, 36 int32 destSampleCount, float gain) 37 { 38 (*fFunc)(this, src, srcSampleOffset, srcSampleCount, dest, destSampleOffset, 39 destSampleCount, gain); 40 } 41 42 #endif // _RESAMPLER_H 43