remove old GetPCM

This commit is contained in:
Glenn Maynard
2006-12-13 18:40:02 +00:00
parent 7fecf43f1d
commit 5bfc731036
2 changed files with 4 additions and 33 deletions
-27
View File
@@ -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()
{
+4 -6
View File
@@ -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 );
};