SoundReader -> RageSoundReader

This commit is contained in:
Glenn Maynard
2006-11-29 02:20:10 +00:00
parent b91f803518
commit f2b893939d
4 changed files with 11 additions and 11 deletions
+4 -4
View File
@@ -148,7 +148,7 @@ void RageSound::Fail( RString sReason )
m_sError = sReason;
}
class RageSoundReader_Silence: public SoundReader
class RageSoundReader_Silence: public RageSoundReader
{
public:
int GetLength() const { return 0; }
@@ -156,7 +156,7 @@ public:
int SetPosition_Accurate(int ms) { return 0; }
int SetPosition_Fast(int ms) { return 0; }
int Read(char *buf, unsigned len) { return 0; }
SoundReader *Copy() const { return new RageSoundReader_Silence; }
RageSoundReader *Copy() const { return new RageSoundReader_Silence; }
int GetSampleRate() const { return 44100; }
bool IsStreamingFromDisk() const { return false; }
};
@@ -175,7 +175,7 @@ bool RageSound::Load( RString sSoundFilePath, bool bPrecache )
/* If this sound is already preloaded and held by SOUNDMAN, just make a copy
* of that. Since RageSoundReader_Preload is refcounted, this is cheap. */
SoundReader *pSound = SOUNDMAN->GetLoadedSound( sSoundFilePath );
RageSoundReader *pSound = SOUNDMAN->GetLoadedSound( sSoundFilePath );
if( pSound == NULL )
{
RString error;
@@ -214,7 +214,7 @@ bool RageSound::Load( RString sSoundFilePath, bool bPrecache )
return true;
}
void RageSound::LoadSoundReader( SoundReader *pSound )
void RageSound::LoadSoundReader( RageSoundReader *pSound )
{
Unload();
+4 -4
View File
@@ -9,7 +9,7 @@
#include "RageUtil_CircularBuffer.h"
#include "RageSoundPosMap.h"
class SoundReader;
class RageSoundReader;
/* Driver interface for sounds: this is what drivers see. */
class RageSoundBase
@@ -106,9 +106,9 @@ public:
*/
bool Load( RString sFile );
/* Load a SoundReader that you've set up yourself. Sample rate conversion will
/* Load a RageSoundReader that you've set up yourself. Sample rate conversion will
* be set up only if needed. Doesn't fail. */
void LoadSoundReader( SoundReader *pSound );
void LoadSoundReader( RageSoundReader *pSound );
void Unload();
bool IsLoaded() const;
@@ -142,7 +142,7 @@ public:
private:
mutable RageMutex m_Mutex;
SoundReader *m_pSource;
RageSoundReader *m_pSource;
CircBuf<char> m_DataBuffer;
bool FillBuf( int iFrames );
+1 -1
View File
@@ -295,7 +295,7 @@ void RageSoundManager::DeleteSoundWhenFinished( RageSound *pSound )
/* If the given path is loaded, return a copy; otherwise return NULL.
* It's the caller's responsibility to delete the result. */
SoundReader *RageSoundManager::GetLoadedSound( const RString &sPath_ )
RageSoundReader *RageSoundManager::GetLoadedSound( const RString &sPath_ )
{
LockMut(g_SoundManMutex); /* lock for access to m_mapPreloadedSounds */
+2 -2
View File
@@ -11,7 +11,7 @@ class RageSound;
class RageSoundBase;
class RageSoundDriver;
struct RageSoundParams;
class SoundReader;
class RageSoundReader;
class RageSoundReader_Preload;
class RageSoundManager
@@ -50,7 +50,7 @@ public:
void DeleteSound( RageSound *pSound );
void DeleteSoundWhenFinished( RageSound *pSound );
SoundReader *GetLoadedSound( const RString &sPath );
RageSoundReader *GetLoadedSound( const RString &sPath );
void AddLoadedSound( const RString &sPath, RageSoundReader_Preload *pSound );
void PlayOnce( RString sPath );