MP3 GetLength is const now, so we can clean this up, too.

This commit is contained in:
Glenn Maynard
2003-09-25 00:43:10 +00:00
parent d692834d07
commit c9a265d5f8
2 changed files with 6 additions and 13 deletions
@@ -21,17 +21,12 @@ RageSoundReader_Resample_Good::RageSoundReader_Resample_Good()
} }
/* Call this if the input position is changed or reset. */ /* Call this if the input position is changed or reset. */
void RageSoundReader_Resample_Good::Reset() const void RageSoundReader_Resample_Good::Reset()
{ {
BufSamples = 0; BufSamples = 0;
eof = false; eof = false;
FlushResampler();
}
/* Flush the resampler. */
/* Call this if the input position is changed or reset. */
void RageSoundReader_Resample_Good::FlushResampler() const
{
for( int i = 0; i < 2; ++i ) for( int i = 0; i < 2; ++i )
{ {
if( resamp[i] ) if( resamp[i] )
@@ -41,8 +36,9 @@ void RageSoundReader_Resample_Good::FlushResampler() const
} }
} }
/* Call this if the sample factor changes. */ /* Call this if the sample factor changes. */
void RageSoundReader_Resample_Good::ReopenResampler() const void RageSoundReader_Resample_Good::ReopenResampler()
{ {
for( int i = 0; i < 2; ++i ) for( int i = 0; i < 2; ++i )
{ {
@@ -89,13 +85,11 @@ void RageSoundReader_Resample_Good::SetSampleRate(int hz)
int RageSoundReader_Resample_Good::GetLength() const int RageSoundReader_Resample_Good::GetLength() const
{ {
Reset();
return source->GetLength(); return source->GetLength();
} }
int RageSoundReader_Resample_Good::GetLength_Fast() const int RageSoundReader_Resample_Good::GetLength_Fast() const
{ {
Reset();
return source->GetLength_Fast(); return source->GetLength_Fast();
} }
@@ -20,9 +20,8 @@ class RageSoundReader_Resample_Good: public RageSoundReader_Resample
mutable int BufSamples; mutable int BufSamples;
mutable bool eof; mutable bool eof;
void Reset() const; void Reset();
void FlushResampler() const; void ReopenResampler();
void ReopenResampler() const;
float GetFactor() const; float GetFactor() const;
bool FillBuf(); bool FillBuf();