From 5bfc731036896b72978b30b6473be25f23f60c08 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 13 Dec 2006 18:40:02 +0000 Subject: [PATCH] remove old GetPCM --- stepmania/src/RageSound.cpp | 27 --------------------------- stepmania/src/RageSound.h | 10 ++++------ 2 files changed, 4 insertions(+), 33 deletions(-) diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index cc1d9eb752..de2d5a5283 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -458,33 +458,6 @@ void RageSound::CommitPlayingPosition( int64_t frameno, int64_t pos, int iGotFra m_Mutex.Unlock(); } -/* Called by the mixer: return a block of sound data. - * Be careful; this is called in a separate thread. */ -int RageSound::GetPCM( char *pBuffer, int iSize, int64_t iFrameno ) -{ - ASSERT( m_bPlaying ); - - /* Now actually put data from the correct buffer into the output. */ - int iBytesStored = 0; - while( iBytesStored < iSize ) - { - int64_t iPosition; - int iGotFrames; - bool bEof = !GetDataToPlay( (int16_t *)(pBuffer+iBytesStored), (iSize-iBytesStored)/framesize, iPosition, iGotFrames ); - - /* Save this frameno/position map. */ - SOUNDMAN->CommitPlayingPosition( GetID(), iFrameno, iPosition, iGotFrames ); - - iBytesStored += iGotFrames * framesize; - iFrameno += iGotFrames; - - if( bEof ) - break; - } - - return iBytesStored; -} - /* Start playing from the current position. */ void RageSound::StartPlaying() { diff --git a/stepmania/src/RageSound.h b/stepmania/src/RageSound.h index 62f9edf7dc..400cfb0077 100644 --- a/stepmania/src/RageSound.h +++ b/stepmania/src/RageSound.h @@ -17,7 +17,6 @@ public: virtual ~RageSoundBase() { } virtual void SoundIsFinishedPlaying() = 0; virtual bool GetDataToPlay( int16_t *buffer, int size, int64_t &iStreamFrame, int &got_bytes ) = 0; - virtual int GetPCM( char *buffer, int size, int64_t frameno ) = 0; virtual int GetSampleRate() const = 0; virtual RageTimer GetStartTime() const { return RageZeroTimer; } virtual float GetAbsoluteVolume() const = 0; @@ -198,11 +197,10 @@ private: public: /* These functions are called only by sound drivers. */ - /* Returns the number of bytes actually put into pBuffer. If less than iSize is - * returned, it signals the stream to stop; once it's flushed, SoundStopped will - * be called. Until then, SOUNDMAN->GetPosition can still be called; the sound - * is still playing. */ - int GetPCM( char *pBuffer, int iSize, int64_t iFrameno ); + /* Returns the number of bytes actually put into pBuffer. If 0 is returned, it + * signals the stream to stop; once it's flushed, SoundStopped will be called. + * Until then, SOUNDMAN->GetPosition can still be called; the sound is still + * playing. */ bool GetDataToPlay( int16_t *pBuffer, int iSize, int64_t &iStreamFrame, int &iBytesRead ); void CommitPlayingPosition( int64_t iFrameno, int64_t iPosition, int iBytesRead ); };