update (Mac drivers untested)

This commit is contained in:
Glenn Maynard
2004-01-15 03:03:57 +00:00
parent 92684a90db
commit fda40a0efd
12 changed files with 43 additions and 43 deletions
@@ -126,7 +126,7 @@ bool RageSound_ALSA9::stream::GetData(bool init)
}
void RageSound_ALSA9::StartMixing(RageSound *snd)
void RageSound_ALSA9::StartMixing(RageSoundBase *snd)
{
LockMutex L(SOUNDMAN->lock);
@@ -192,7 +192,7 @@ void RageSound_ALSA9::Update(float delta)
}
void RageSound_ALSA9::StopMixing(RageSound *snd)
void RageSound_ALSA9::StopMixing(RageSoundBase *snd)
{
ASSERT(snd != NULL);
LockMutex L(SOUNDMAN->lock);
@@ -215,14 +215,14 @@ void RageSound_ALSA9::StopMixing(RageSound *snd)
/* Flush two buffers worth of data. */
stream_pool[i]->flush_pos = stream_pool[i]->pcm->GetPlayPos();
/* This function is called externally (by RageSound) to stop immediately.
/* This function is called externally (by RageSoundBase) to stop immediately.
* We need to prevent SoundStopped from being called; it should only be
* called when we stop implicitely at the end of a sound. Set snd to NULL. */
stream_pool[i]->snd = NULL;
}
int RageSound_ALSA9::GetPosition(const RageSound *snd) const
int RageSound_ALSA9::GetPosition(const RageSoundBase *snd) const
{
LockMutex L(SOUNDMAN->lock);
@@ -17,7 +17,7 @@ private:
/* Sound object that's playing on this stream, or NULL if this
* channel is available: */
RageSound *snd;
RageSoundBase *snd;
RageTimer start_time;
enum {
@@ -49,9 +49,9 @@ private:
public:
/* virtuals: */
void StartMixing(RageSound *snd);
void StopMixing(RageSound *snd);
int GetPosition(const RageSound *snd) const;
void StartMixing(RageSoundBase *snd);
void StopMixing(RageSoundBase *snd);
int GetPosition(const RageSoundBase *snd) const;
int GetSampleRate( int rate ) const;
void Update(float delta);
@@ -132,7 +132,7 @@ bool RageSound_ALSA9_Software::GetData()
}
void RageSound_ALSA9_Software::StartMixing(RageSound *snd)
void RageSound_ALSA9_Software::StartMixing(RageSoundBase *snd)
{
sound *s = new sound;
s->snd = snd;
@@ -161,7 +161,7 @@ void RageSound_ALSA9_Software::Update(float delta)
}
}
void RageSound_ALSA9_Software::StopMixing(RageSound *snd)
void RageSound_ALSA9_Software::StopMixing(RageSoundBase *snd)
{
LockMutex L(SOUNDMAN->lock);
@@ -185,7 +185,7 @@ void RageSound_ALSA9_Software::StopMixing(RageSound *snd)
}
int RageSound_ALSA9_Software::GetPosition(const RageSound *snd) const
int RageSound_ALSA9_Software::GetPosition(const RageSoundBase *snd) const
{
return pcm->GetPosition();
}
@@ -12,7 +12,7 @@ class RageSound_ALSA9_Software: public RageSoundDriver
private:
struct sound
{
RageSound *snd;
RageSoundBase *snd;
RageTimer start_time;
bool stopping;
int flush_pos; /* state == STOPPING only */
@@ -34,9 +34,9 @@ private:
public:
/* virtuals: */
void StartMixing(RageSound *snd);
void StopMixing(RageSound *snd);
int GetPosition(const RageSound *snd) const;
void StartMixing(RageSoundBase *snd);
void StopMixing(RageSoundBase *snd);
int GetPosition(const RageSoundBase *snd) const;
float GetPlayLatency() const;
int GetSampleRate( int rate ) const;
@@ -223,7 +223,7 @@ RageSound_CA::~RageSound_CA()
#endif
}
void RageSound_CA::StartMixing(RageSound *snd)
void RageSound_CA::StartMixing(RageSoundBase *snd)
{
LockMutex L(SOUNDMAN->lock);
soundPtr s = new sound;
@@ -231,7 +231,7 @@ void RageSound_CA::StartMixing(RageSound *snd)
sounds.push_back(s);
}
void RageSound_CA::StopMixing(RageSound *snd)
void RageSound_CA::StopMixing(RageSoundBase *snd)
{
LockMutex L(SOUNDMAN->lock);
@@ -249,7 +249,7 @@ void RageSound_CA::StopMixing(RageSound *snd)
sounds.erase(sounds.begin()+i);
}
int RageSound_CA::GetPosition(const RageSound *snd) const
int RageSound_CA::GetPosition(const RageSoundBase *snd) const
{
AudioTimeStamp time;
OSStatus err = AudioDeviceGetCurrentTime(outputDevice, &time);
@@ -34,7 +34,7 @@ class RageSound_CA : public RageSoundDriver
{
private:
typedef struct sound {
RageSound *snd;
RageSoundBase *snd;
bool stopping;
int flush_pos;
sound() { snd=NULL; stopping=false; flush_pos=0; }
@@ -52,9 +52,9 @@ private:
static int ConvertAudioTimeStampToPosition(const AudioTimeStamp *time);
protected:
virtual void StartMixing(RageSound *snd);
virtual void StopMixing(RageSound *snd);
virtual int GetPosition(const RageSound *snd) const;
virtual void StartMixing(RageSoundBase *snd);
virtual void StopMixing(RageSoundBase *snd);
virtual int GetPosition(const RageSoundBase *snd) const;
virtual void Update (float delta);
virtual float GetPlayLatency() const { return latency; }
@@ -133,7 +133,7 @@ bool RageSound_OSS::GetData()
return true;
}
void RageSound_OSS::StartMixing(RageSound *snd)
void RageSound_OSS::StartMixing(RageSoundBase *snd)
{
sound *s = new sound;
s->snd = snd;
@@ -162,7 +162,7 @@ void RageSound_OSS::Update(float delta)
}
}
void RageSound_OSS::StopMixing(RageSound *snd)
void RageSound_OSS::StopMixing(RageSoundBase *snd)
{
LockMutex L(SOUNDMAN->lock);
@@ -180,7 +180,7 @@ void RageSound_OSS::StopMixing(RageSound *snd)
sounds.erase(sounds.begin()+i, sounds.begin()+i+1);
}
int RageSound_OSS::GetPosition(const RageSound *snd) const
int RageSound_OSS::GetPosition(const RageSoundBase *snd) const
{
LockMutex L(SOUNDMAN->lock);
@@ -10,7 +10,7 @@ class RageSound_OSS: public RageSoundDriver
int fd;
struct sound {
RageSound *snd;
RageSoundBase *snd;
RageTimer start_time;
bool stopping;
@@ -37,9 +37,9 @@ public:
int GetSampleRate( int rate ) const { return samplerate; }
/* virtuals: */
void StartMixing(RageSound *snd); /* used by RageSound */
void StopMixing(RageSound *snd); /* used by RageSound */
int GetPosition(const RageSound *snd) const;
void StartMixing(RageSoundBase *snd); /* used by RageSoundBase */
void StopMixing(RageSoundBase *snd); /* used by RageSoundBase */
int GetPosition(const RageSoundBase *snd) const;
float GetPlayLatency() const;
RageSound_OSS();
@@ -35,7 +35,7 @@ RageException::Throw(#func " failed with error: %d at %s:%d", err, __FILE__, __L
typedef struct soundInfo
{
RageSound *snd;
RageSoundBase *snd;
long stopPos;
bool stopping;
@@ -218,7 +218,7 @@ RageSound_QT::~RageSound_QT()
DisposeHandle(Handle(sndDescHdl));
}
void RageSound_QT::StartMixing(RageSound *snd)
void RageSound_QT::StartMixing(RageSoundBase *snd)
{
LockMutex L(SOUNDMAN->lock);
CHECKPOINT;
@@ -228,7 +228,7 @@ void RageSound_QT::StartMixing(RageSound *snd)
sounds.push_back(s);
}
void RageSound_QT::StopMixing(RageSound *snd)
void RageSound_QT::StopMixing(RageSoundBase *snd)
{
LockMutex L(SOUNDMAN->lock);
CHECKPOINT;
@@ -260,7 +260,7 @@ void RageSound_QT::Update(float delta)
}
}
int RageSound_QT::GetPosition(const RageSound *snd) const
int RageSound_QT::GetPosition(const RageSoundBase *snd) const
{
LockMutex L(SOUNDMAN->lock);
return GetMovieTime(movie, NULL);
@@ -15,9 +15,9 @@
class RageSound_QT: public RageSoundDriver {
protected:
virtual void StartMixing(RageSound *snd);
virtual void StopMixing(RageSound *snd);
virtual int GetPosition(const RageSound *snd) const;
virtual void StartMixing(RageSoundBase *snd);
virtual void StopMixing(RageSoundBase *snd);
virtual int GetPosition(const RageSoundBase *snd) const;
virtual void Update (float delta);
virtual float GetPlayLatency() const;
@@ -152,7 +152,7 @@ bail:
}
void RageSound_QT1::StartMixing(RageSound *snd) {
void RageSound_QT1::StartMixing(RageSoundBase *snd) {
sound *s = new sound;
s->snd = snd;
@@ -161,7 +161,7 @@ void RageSound_QT1::StartMixing(RageSound *snd) {
LOG->Trace("There are %ld sounds playing", sounds.size());
}
void RageSound_QT1::StopMixing(RageSound *snd) {
void RageSound_QT1::StopMixing(RageSoundBase *snd) {
LockMutex L(SOUNDMAN->lock);
/* Find the sound. */
@@ -193,7 +193,7 @@ void RageSound_QT1::Update(float delta) {
}
}
int RageSound_QT1::GetPosition(const RageSound *snd) const {
int RageSound_QT1::GetPosition(const RageSoundBase *snd) const {
#pragma unused (snd)
TimeRecord tr;
ClockGetTime(clock, &tr);
@@ -26,7 +26,7 @@ namespace QT {
class RageSound_QT1: public RageSoundDriver {
private:
struct sound {
RageSound *snd;
RageSoundBase *snd;
bool stopping;
int flush_pos;
sound() { snd=NULL; stopping=false; flush_pos=0; }
@@ -39,9 +39,9 @@ private:
float latency;
protected:
virtual void StartMixing(RageSound *snd);
virtual void StopMixing(RageSound *snd);
virtual int GetPosition(const RageSound *snd) const;
virtual void StartMixing(RageSoundBase *snd);
virtual void StopMixing(RageSoundBase *snd);
virtual int GetPosition(const RageSoundBase *snd) const;
virtual void Update (float delta);
virtual float GetPlayLatency() const;