Move the linear resampler to RageSoundReader_Resample_Fast.

Add RageSoundReader_Resample_Good, using libresample.
This commit is contained in:
Glenn Maynard
2003-09-24 22:31:34 +00:00
parent 83c58f3b3a
commit 6954e0facf
6 changed files with 440 additions and 113 deletions
+4 -17
View File
@@ -7,28 +7,15 @@
/* This class changes the sampling rate of a sound. */
class RageSoundReader_Resample: public SoundReader
{
int samplerate;
SoundReader *source;
mutable RageSoundResampler resamp;
public:
/* We own source. */
void Open(SoundReader *source);
int GetLength() const;
int GetLength_Fast() const;
int SetPosition_Accurate(int ms);
int SetPosition_Fast(int ms);
int Read(char *buf, unsigned len);
RageSoundReader_Resample();
virtual ~RageSoundReader_Resample();
SoundReader *Copy() const;
virtual void Open(SoundReader *source) = 0;
/* Change the actual sample rate of a sound. */
void SetSampleRate(int hz);
virtual void SetSampleRate(int hz) = 0;
int GetSampleRate() const { return samplerate; }
enum ResampleQuality { RESAMP_FAST, RESAMP_NORMAL, RESAMP_HIGHQUALITY };
static RageSoundReader_Resample *MakeResampler( ResampleQuality q );
};
#endif