GetSampleRate(int) -> GetSampleRate(); one sample rate

per driver
This commit is contained in:
Glenn Maynard
2006-12-13 09:13:41 +00:00
parent f75a281c18
commit 0f76adec67
14 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -241,7 +241,7 @@ int RageSoundManager::GetDriverSampleRate( int iRate ) const
if( m_pDriver == NULL ) if( m_pDriver == NULL )
return 44100; return 44100;
return m_pDriver->GetSampleRate( iRate ); return m_pDriver->GetSampleRate();
} }
/* The return value of PlaySound and PlayCopyOfSound is only valid in the main /* The return value of PlaySound and PlayCopyOfSound is only valid in the main
+1 -1
View File
@@ -45,7 +45,7 @@ public:
* hearing it. (This isn't necessarily the same as the buffer latency.) */ * hearing it. (This isn't necessarily the same as the buffer latency.) */
virtual float GetPlayLatency() const { return 0.0f; } virtual float GetPlayLatency() const { return 0.0f; }
virtual int GetSampleRate( int rate ) const { return 44100; } virtual int GetSampleRate() const { return 44100; }
virtual ~RageSoundDriver() { } virtual ~RageSoundDriver() { }
}; };
@@ -17,7 +17,7 @@ public:
/* virtuals: */ /* virtuals: */
int64_t GetPosition() const; int64_t GetPosition() const;
float GetPlayLatency() const; float GetPlayLatency() const;
int GetSampleRate( int iRate ) const { return m_iSampleRate; } int GetSampleRate() const { return m_iSampleRate; }
void SetupDecodingThread(); void SetupDecodingThread();
@@ -12,7 +12,7 @@ public:
RString Init(); RString Init();
~RageSoundDriver_AU(); ~RageSoundDriver_AU();
float GetPlayLatency() const; float GetPlayLatency() const;
int GetSampleRate( int rate ) const { return m_iSampleRate; } int GetSampleRate() const { return m_iSampleRate; }
int64_t GetPosition() const; int64_t GetPosition() const;
protected: protected:
@@ -16,7 +16,7 @@ public:
RString Init(); RString Init();
~RageSoundDriver_CA(); ~RageSoundDriver_CA();
float GetPlayLatency() const { return m_fLatency; } float GetPlayLatency() const { return m_fLatency; }
int GetSampleRate( int rate ) const { return m_iSampleRate; } int GetSampleRate() const { return m_iSampleRate; }
int64_t GetPosition() const; int64_t GetPosition() const;
void SetupDecodingThread(); void SetupDecodingThread();
@@ -138,7 +138,7 @@ float RageSoundDriver_DSound_Software::GetPlayLatency() const
return (1.0f / m_iSampleRate) * g_iMaxWriteahead; return (1.0f / m_iSampleRate) * g_iMaxWriteahead;
} }
int RageSoundDriver_DSound_Software::GetSampleRate( int rate ) const int RageSoundDriver_DSound_Software::GetSampleRate() const
{ {
return m_iSampleRate; return m_iSampleRate;
} }
@@ -14,7 +14,7 @@ public:
int64_t GetPosition() const; int64_t GetPosition() const;
float GetPlayLatency() const; float GetPlayLatency() const;
int GetSampleRate( int rate ) const; int GetSampleRate() const;
protected: protected:
void SetupDecodingThread(); void SetupDecodingThread();
@@ -93,7 +93,7 @@ RageSoundMixBuffer &RageSound_Generic_Software::MixIntoBuffer( int iFrames, int6
/* If the sound is supposed to start at a time past this buffer, insert silence. */ /* If the sound is supposed to start at a time past this buffer, insert silence. */
const int64_t iFramesUntilThisBuffer = iFrameNumber - iCurrentFrame; const int64_t iFramesUntilThisBuffer = iFrameNumber - iCurrentFrame;
const float fSecondsBeforeStart = -s.m_StartTime.Ago(); const float fSecondsBeforeStart = -s.m_StartTime.Ago();
const int64_t iFramesBeforeStart = int64_t(fSecondsBeforeStart * GetSampleRate(0)); const int64_t iFramesBeforeStart = int64_t(fSecondsBeforeStart * GetSampleRate());
const int iSilentFramesInThisBuffer = clamp( int(iFramesBeforeStart-iFramesUntilThisBuffer), 0, iFramesLeft ); const int iSilentFramesInThisBuffer = clamp( int(iFramesBeforeStart-iFramesUntilThisBuffer), 0, iFramesLeft );
iGotFrames += iSilentFramesInThisBuffer; iGotFrames += iSilentFramesInThisBuffer;
@@ -180,7 +180,7 @@ void RageSound_Generic_Software::DecodeThread()
{ {
/* Fill each playing sound, round-robin. */ /* Fill each playing sound, round-robin. */
{ {
int iSampleRate = GetSampleRate(0); int iSampleRate = GetSampleRate();
ASSERT_M( iSampleRate > 0, ssprintf("%i", iSampleRate) ); ASSERT_M( iSampleRate > 0, ssprintf("%i", iSampleRate) );
int iUsecs = 1000000*chunksize() / iSampleRate; int iUsecs = 1000000*chunksize() / iSampleRate;
usleep( iUsecs ); usleep( iUsecs );
@@ -35,7 +35,7 @@ RageSoundDriver_Null::RageSoundDriver_Null()
StartDecodeThread(); StartDecodeThread();
} }
int RageSoundDriver_Null::GetSampleRate( int iRate ) const int RageSoundDriver_Null::GetSampleRate() const
{ {
return m_iSampleRate; return m_iSampleRate;
} }
@@ -8,7 +8,7 @@ class RageSoundDriver_Null: public RageSound_Generic_Software
public: public:
RageSoundDriver_Null(); RageSoundDriver_Null();
int64_t GetPosition() const; int64_t GetPosition() const;
int GetSampleRate( int iRate ) const; int GetSampleRate() const;
void Update(); void Update();
private: private:
@@ -21,7 +21,7 @@ class RageSoundDriver_OSS: public RageSound_Generic_Software
public: public:
bool GetData(); bool GetData();
int GetSampleRate( int rate ) const { return samplerate; } int GetSampleRate() const { return samplerate; }
/* virtuals: */ /* virtuals: */
int64_t GetPosition() const; int64_t GetPosition() const;
@@ -1356,7 +1356,7 @@ RageSoundDriver_WDMKS::~RageSoundDriver_WDMKS()
CloseHandle( m_hSignal ); CloseHandle( m_hSignal );
} }
int RageSoundDriver_WDMKS::GetSampleRate( int iRate ) const int RageSoundDriver_WDMKS::GetSampleRate() const
{ {
return m_pStream->m_iSampleRate; return m_pStream->m_iSampleRate;
} }
@@ -17,7 +17,7 @@ public:
int64_t GetPosition() const; int64_t GetPosition() const;
float GetPlayLatency() const; float GetPlayLatency() const;
int GetSampleRate( int iRate ) const; int GetSampleRate() const;
private: private:
static int MixerThread_start( void *p ); static int MixerThread_start( void *p );
@@ -15,7 +15,7 @@ public:
int64_t GetPosition() const; int64_t GetPosition() const;
float GetPlayLatency() const; float GetPlayLatency() const;
int GetSampleRate( int rate ) const { return m_iSampleRate; } int GetSampleRate() const { return m_iSampleRate; }
private: private:
static int MixerThread_start( void *p ); static int MixerThread_start( void *p );