RageSoundReader::Read(char *) -> int16_t *. This was originally

char * based on the idea of supporting more than one sample type.
I don't plan to do that (though I may change the sample type to float
or int32).
This commit is contained in:
Glenn Maynard
2007-01-20 01:10:24 +00:00
parent 29edd8be6c
commit fd4b5f93bb
29 changed files with 94 additions and 97 deletions
+3 -3
View File
@@ -48,7 +48,7 @@ int RageSoundReader_Extend::GetEndFrame() const
return m_iStartFrames + m_iLengthFrames;
}
int RageSoundReader_Extend::GetData( char *pBuffer, int iFrames )
int RageSoundReader_Extend::GetData( int16_t *pBuffer, int iFrames )
{
int iFramesToRead = iFrames;
if( m_iLengthFrames != -1 )
@@ -80,7 +80,7 @@ int RageSoundReader_Extend::GetData( char *pBuffer, int iFrames )
return iRet;
}
int RageSoundReader_Extend::Read( char *pBuffer, int iFrames )
int RageSoundReader_Extend::Read( int16_t *pBuffer, int iFrames )
{
int iFramesRead = GetData( pBuffer, iFrames );
if( iFramesRead == RageSoundReader::END_OF_FILE )
@@ -109,7 +109,7 @@ int RageSoundReader_Extend::Read( char *pBuffer, int iFrames )
const int iEndSecond = m_iPositionFrames + iFramesRead;
const float fStartVolume = SCALE( iStartSecond, iStartFadingOutAt, iFinishFadingOutAt, 1.0f, 0.0f );
const float fEndVolume = SCALE( iEndSecond, iStartFadingOutAt, iFinishFadingOutAt, 1.0f, 0.0f );
RageSoundUtil::Fade( (int16_t *) pBuffer, iFramesRead, fStartVolume, fEndVolume );
RageSoundUtil::Fade( pBuffer, iFramesRead, fStartVolume, fEndVolume );
}
m_iPositionFrames += iFramesRead;