remove old GetPCM
This commit is contained in:
@@ -458,33 +458,6 @@ void RageSound::CommitPlayingPosition( int64_t frameno, int64_t pos, int iGotFra
|
|||||||
m_Mutex.Unlock();
|
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. */
|
/* Start playing from the current position. */
|
||||||
void RageSound::StartPlaying()
|
void RageSound::StartPlaying()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ public:
|
|||||||
virtual ~RageSoundBase() { }
|
virtual ~RageSoundBase() { }
|
||||||
virtual void SoundIsFinishedPlaying() = 0;
|
virtual void SoundIsFinishedPlaying() = 0;
|
||||||
virtual bool GetDataToPlay( int16_t *buffer, int size, int64_t &iStreamFrame, int &got_bytes ) = 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 int GetSampleRate() const = 0;
|
||||||
virtual RageTimer GetStartTime() const { return RageZeroTimer; }
|
virtual RageTimer GetStartTime() const { return RageZeroTimer; }
|
||||||
virtual float GetAbsoluteVolume() const = 0;
|
virtual float GetAbsoluteVolume() const = 0;
|
||||||
@@ -198,11 +197,10 @@ private:
|
|||||||
public:
|
public:
|
||||||
/* These functions are called only by sound drivers. */
|
/* These functions are called only by sound drivers. */
|
||||||
|
|
||||||
/* Returns the number of bytes actually put into pBuffer. If less than iSize is
|
/* Returns the number of bytes actually put into pBuffer. If 0 is returned, it
|
||||||
* returned, it signals the stream to stop; once it's flushed, SoundStopped will
|
* signals the stream to stop; once it's flushed, SoundStopped will be called.
|
||||||
* be called. Until then, SOUNDMAN->GetPosition can still be called; the sound
|
* Until then, SOUNDMAN->GetPosition can still be called; the sound is still
|
||||||
* is still playing. */
|
* playing. */
|
||||||
int GetPCM( char *pBuffer, int iSize, int64_t iFrameno );
|
|
||||||
bool GetDataToPlay( int16_t *pBuffer, int iSize, int64_t &iStreamFrame, int &iBytesRead );
|
bool GetDataToPlay( int16_t *pBuffer, int iSize, int64_t &iStreamFrame, int &iBytesRead );
|
||||||
void CommitPlayingPosition( int64_t iFrameno, int64_t iPosition, int iBytesRead );
|
void CommitPlayingPosition( int64_t iFrameno, int64_t iPosition, int iBytesRead );
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user