add RageSound::SoundIsFinishedPlaying (replaces StopPlaying for
use from sound drivers)
This commit is contained in:
@@ -607,6 +607,27 @@ void RageSound::StopPlaying()
|
|||||||
pos_map.clear();
|
pos_map.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This is similar to StopPlaying, except it's called by sound drivers when we're done
|
||||||
|
* playing, rather than by users to as us to stop. (The only difference is that this
|
||||||
|
* doesn't call SOUNDMAN->StopMixing; there's no reason to tell the sound driver to
|
||||||
|
* stop mixing, since they're the one telling us we're done.) */
|
||||||
|
void RageSound::SoundIsFinishedPlaying()
|
||||||
|
{
|
||||||
|
if(!playing)
|
||||||
|
return;
|
||||||
|
|
||||||
|
stopped_position = (int) GetPositionSecondsInternal();
|
||||||
|
|
||||||
|
SOUNDMAN->lock.Lock();
|
||||||
|
SOUNDMAN->playing_sounds.erase( this );
|
||||||
|
SOUNDMAN->lock.Unlock();
|
||||||
|
|
||||||
|
playing = false;
|
||||||
|
playing_thread = 0;
|
||||||
|
|
||||||
|
pos_map.clear();
|
||||||
|
}
|
||||||
|
|
||||||
RageSound *RageSound::Play( const RageSoundParams *params )
|
RageSound *RageSound::Play( const RageSoundParams *params )
|
||||||
{
|
{
|
||||||
return SOUNDMAN->PlaySound( *this, params );
|
return SOUNDMAN->PlaySound( *this, params );
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ class RageSoundBase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~RageSoundBase() { }
|
virtual ~RageSoundBase() { }
|
||||||
virtual void StopPlaying() = 0;
|
virtual void StopPlaying() = 0; // deprecated
|
||||||
|
virtual void SoundIsFinishedPlaying() = 0;
|
||||||
virtual bool GetDataToPlay( int16_t *buffer, int size, int &pos, int &got_bytes ) = 0;
|
virtual bool GetDataToPlay( int16_t *buffer, int size, int &pos, int &got_bytes ) = 0;
|
||||||
virtual int GetPCM( char *buffer, int size, int64_t frameno ) = 0;
|
virtual int GetPCM( char *buffer, int size, int64_t frameno ) = 0;
|
||||||
virtual int GetSampleRate() const = 0;
|
virtual int GetSampleRate() const = 0;
|
||||||
@@ -174,6 +175,8 @@ private:
|
|||||||
int Bytes_Available() const;
|
int Bytes_Available() const;
|
||||||
RageSoundParams::StopMode_t GetStopMode() const; /* resolves M_AUTO */
|
RageSoundParams::StopMode_t GetStopMode() const; /* resolves M_AUTO */
|
||||||
|
|
||||||
|
void SoundIsFinishedPlaying(); // called by sound drivers
|
||||||
|
|
||||||
static void RateChange(char *buf, int &cnt, int speed_input_samples, int speed_output_samples, int channels);
|
static void RateChange(char *buf, int &cnt, int speed_input_samples, int speed_output_samples, int channels);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user