Update of /cvsroot/stepmania/stepmania/src/arch/Sound
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4304
Modified Files:
RageSoundDriver.h RageSoundDriver_ALSA9_Software.cpp
RageSoundDriver_ALSA9_Software.h RageSoundDriver_AU.cpp
RageSoundDriver_AU.h RageSoundDriver_CA.cpp
RageSoundDriver_CA.h RageSoundDriver_DSound_Software.cpp
RageSoundDriver_DSound_Software.h RageSoundDriver_Null.cpp
RageSoundDriver_Null.h RageSoundDriver_OSS.cpp
RageSoundDriver_OSS.h RageSoundDriver_WaveOut.cpp
RageSoundDriver_WaveOut.h RageSoundDriver_WDMKS.cpp
RageSoundDriver_WDMKS.h
Log Message:
GetPosition(pSound) -> GetPosition(); one hardware sound position
per driver
Index: RageSoundDriver_AU.cpp
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_AU.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -p -r1.9 -r1.10
--- RageSoundDriver_AU.cpp 11 Dec 2006 13:55:05 -0000 1.9
+++ RageSoundDriver_AU.cpp 13 Dec 2006 09:09:40 -0000 1.10
@@ -184,7 +184,7 @@ RageSoundDriver_AU::~RageSoundDriver_AU(
delete m_pNotificationThread;
}
-int64_t RageSoundDriver_AU::GetPosition( const RageSoundBase *sound ) const
+int64_t RageSoundDriver_AU::GetPosition() const
{
double scale = m_iSampleRate / AudioGetHostClockFrequency();
return int64_t( scale * AudioGetCurrentHostTime() );
Index: RageSoundDriver_ALSA9_Software.cpp
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_ALSA9_Software.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -p -r1.38 -r1.39
--- RageSoundDriver_ALSA9_Software.cpp 7 Dec 2006 02:16:51 -0000 1.38
+++ RageSoundDriver_ALSA9_Software.cpp 13 Dec 2006 09:09:40 -0000 1.39
@@ -67,7 +67,7 @@ bool RageSoundDriver_ALSA9_Software::Get
}
-int64_t RageSoundDriver_ALSA9_Software::GetPosition( const RageSoundBase *pSound ) const
+int64_t RageSoundDriver_ALSA9_Software::GetPosition() const
{
return m_pPCM->GetPosition();
}
Index: RageSoundDriver_Null.h
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_Null.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -p -r1.19 -r1.20
--- RageSoundDriver_Null.h 7 Dec 2006 02:16:51 -0000 1.19
+++ RageSoundDriver_Null.h 13 Dec 2006 09:09:40 -0000 1.20
@@ -7,7 +7,7 @@ class RageSoundDriver_Null: public RageS
{
public:
RageSoundDriver_Null();
- int64_t GetPosition( const RageSoundBase *snd ) const;
+ int64_t GetPosition() const;
int GetSampleRate( int iRate ) const;
void Update();
Index: RageSoundDriver_WDMKS.h
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_WDMKS.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -p -r1.2 -r1.3
--- RageSoundDriver_WDMKS.h 7 Dec 2006 02:16:51 -0000 1.2
+++ RageSoundDriver_WDMKS.h 13 Dec 2006 09:09:40 -0000 1.3
@@ -15,7 +15,7 @@ public:
~RageSoundDriver_WDMKS();
RString Init();
- int64_t GetPosition( const RageSoundBase *pSound ) const;
+ int64_t GetPosition() const;
float GetPlayLatency() const;
int GetSampleRate( int iRate ) const;
Index: RageSoundDriver_DSound_Software.h
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -p -r1.23 -r1.24
--- RageSoundDriver_DSound_Software.h 7 Dec 2006 02:16:51 -0000 1.23
+++ RageSoundDriver_DSound_Software.h 13 Dec 2006 09:09:40 -0000 1.24
@@ -12,7 +12,7 @@ public:
virtual ~RageSoundDriver_DSound_Software();
RString Init();
- int64_t GetPosition( const RageSoundBase *pSound ) const;
+ int64_t GetPosition() const;
float GetPlayLatency() const;
int GetSampleRate( int rate ) const;
Index: RageSoundDriver_OSS.cpp
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_OSS.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -p -r1.23 -r1.24
--- RageSoundDriver_OSS.cpp 7 Dec 2006 02:16:51 -0000 1.23
+++ RageSoundDriver_OSS.cpp 13 Dec 2006 09:09:40 -0000 1.24
@@ -73,7 +73,7 @@ bool RageSoundDriver_OSS::GetData()
if(!buf)
buf = new int16_t[chunksize / sizeof(int16_t)];
- this->Mix( buf, chunksize/bytes_per_frame, last_cursor_pos, GetPosition( NULL ) );
+ this->Mix( buf, chunksize/bytes_per_frame, last_cursor_pos, GetPosition() );
int wrote = write( fd, buf, chunksize );
if( wrote != chunksize )
@@ -87,7 +87,7 @@ bool RageSoundDriver_OSS::GetData()
/* XXX: There's a race on last_cursor_pos here: new data might be written after the
* ioctl returns, incrementing last_cursor_pos. */
-int64_t RageSoundDriver_OSS::GetPosition(const RageSoundBase *snd) const
+int64_t RageSoundDriver_OSS::GetPosition() const
{
ASSERT( fd != -1 );
Index: RageSoundDriver.h
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -p -r1.20 -r1.21
--- RageSoundDriver.h 7 Dec 2006 02:16:51 -0000 1.20
+++ RageSoundDriver.h 13 Dec 2006 09:09:40 -0000 1.21
@@ -30,9 +30,9 @@ public:
* playing the sound, either). */
virtual bool PauseMixing( RageSoundBase *snd, bool bStop ) = 0;
- /* Get the current position of a given buffer, in the same units and time base
- * as passed to RageSound::GetPCM. */
- virtual int64_t GetPosition( const RageSoundBase *snd ) const = 0;
+ /* Get the current hardware frame position, in the same time base as passed to
+ * RageSound::CommitPlayingPosition. */
+ virtual int64_t GetPosition() const = 0;
/* When a sound is finished playing (GetPCM returns less than requested) and
* the sound has been completely flushed (so GetPosition is no longer meaningful),
Index: RageSoundDriver_Null.cpp
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_Null.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -p -r1.24 -r1.25
--- RageSoundDriver_Null.cpp 7 Dec 2006 02:16:51 -0000 1.24
+++ RageSoundDriver_Null.cpp 13 Dec 2006 09:09:40 -0000 1.25
@@ -11,17 +11,17 @@ const int channels = 2;
void RageSoundDriver_Null::Update()
{
/* "Play" frames. */
- while( m_iLastCursorPos < GetPosition(NULL)+1024*4 )
+ while( m_iLastCursorPos < GetPosition()+1024*4 )
{
int16_t buf[256*channels];
- this->Mix( buf, 256, m_iLastCursorPos, GetPosition(NULL) );
+ this->Mix( buf, 256, m_iLastCursorPos, GetPosition() );
m_iLastCursorPos += 256;
}
RageSound_Generic_Software::Update();
}
-int64_t RageSoundDriver_Null::GetPosition( const RageSoundBase *snd ) const
+int64_t RageSoundDriver_Null::GetPosition() const
{
return int64_t( RageTimer::GetTimeSinceStart() * m_iSampleRate );
}
@@ -31,7 +31,7 @@ RageSoundDriver_Null::RageSoundDriver_Nu
m_iSampleRate = PREFSMAN->m_iSoundPreferredSampleRate;
if( m_iSampleRate == 0 )
m_iSampleRate = 44100;
- m_iLastCursorPos = GetPosition( NULL );
+ m_iLastCursorPos = GetPosition();
StartDecodeThread();
}
Index: RageSoundDriver_ALSA9_Software.h
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_ALSA9_Software.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -p -r1.16 -r1.17
--- RageSoundDriver_ALSA9_Software.h 7 Dec 2006 02:16:51 -0000 1.16
+++ RageSoundDriver_ALSA9_Software.h 13 Dec 2006 09:09:40 -0000 1.17
@@ -15,7 +15,7 @@ public:
RString Init();
/* virtuals: */
- int64_t GetPosition( const RageSoundBase *pSound ) const;
+ int64_t GetPosition() const;
float GetPlayLatency() const;
int GetSampleRate( int iRate ) const { return m_iSampleRate; }
Index: RageSoundDriver_CA.cpp
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -p -r1.76 -r1.77
--- RageSoundDriver_CA.cpp 7 Dec 2006 02:16:51 -0000 1.76
+++ RageSoundDriver_CA.cpp 13 Dec 2006 09:09:40 -0000 1.77
@@ -373,7 +373,7 @@ void RageSoundDriver_CA::RemoveListeners
}
}
-int64_t RageSoundDriver_CA::GetPosition( const RageSoundBase *sound ) const
+int64_t RageSoundDriver_CA::GetPosition() const
{
AudioTimeStamp time;
OSStatus error;
Index: RageSoundDriver_WDMKS.cpp
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_WDMKS.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -p -r1.6 -r1.7
--- RageSoundDriver_WDMKS.cpp 7 Dec 2006 07:54:41 -0000 1.6
+++ RageSoundDriver_WDMKS.cpp 13 Dec 2006 09:09:40 -0000 1.7
@@ -1152,7 +1152,7 @@ void RageSoundDriver_WDMKS::Read( void *
bool RageSoundDriver_WDMKS::Fill( int iPacket, RString &sError )
{
- uint64_t iCurrentFrame = GetPosition( NULL );
+ uint64_t iCurrentFrame = GetPosition();
// if( iCurrentFrame == m_iLastCursorPos )
// LOG->Trace( "underrun" );
@@ -1246,7 +1246,7 @@ void RageSoundDriver_WDMKS::SetupDecodin
LOG->Warn( werr_ssprintf(GetLastError(), "Failed to set sound thread priority") );
}
-int64_t RageSoundDriver_WDMKS::GetPosition( const RageSoundBase *pSound ) const
+int64_t RageSoundDriver_WDMKS::GetPosition() const
{
KSAUDIO_POSITION pos;
Index: RageSoundDriver_DSound_Software.cpp
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -p -r1.58 -r1.59
--- RageSoundDriver_DSound_Software.cpp 7 Dec 2006 02:16:51 -0000 1.58
+++ RageSoundDriver_DSound_Software.cpp 13 Dec 2006 09:09:40 -0000 1.59
@@ -60,7 +60,7 @@ void RageSoundDriver_DSound_Software::Mi
m_pPCM->Stop();
}
-int64_t RageSoundDriver_DSound_Software::GetPosition( const RageSoundBase *pSound ) const
+int64_t RageSoundDriver_DSound_Software::GetPosition() const
{
return m_pPCM->GetPosition();
}
Index: RageSoundDriver_OSS.h
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_OSS.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -p -r1.13 -r1.14
--- RageSoundDriver_OSS.h 7 Dec 2006 02:16:51 -0000 1.13
+++ RageSoundDriver_OSS.h 13 Dec 2006 09:09:40 -0000 1.14
@@ -24,7 +24,7 @@ public:
int GetSampleRate( int rate ) const { return samplerate; }
/* virtuals: */
- int64_t GetPosition( const RageSoundBase *snd ) const;
+ int64_t GetPosition() const;
float GetPlayLatency() const;
void SetupDecodingThread();
Index: RageSoundDriver_WaveOut.cpp
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -p -r1.49 -r1.50
--- RageSoundDriver_WaveOut.cpp 7 Dec 2006 02:16:51 -0000 1.49
+++ RageSoundDriver_WaveOut.cpp 13 Dec 2006 09:09:40 -0000 1.50
@@ -70,7 +70,7 @@ bool RageSoundDriver_WaveOut::GetData()
return false;
/* Call the callback. */
- this->Mix( (int16_t *) m_aBuffers[b].lpData, chunksize_frames, m_iLastCursorPos, GetPosition( NULL ) );
+ this->Mix( (int16_t *) m_aBuffers[b].lpData, chunksize_frames, m_iLastCursorPos, GetPosition() );
MMRESULT ret = waveOutWrite( m_hWaveOut, &m_aBuffers[b], sizeof(m_aBuffers[b]) );
if(ret != MMSYSERR_NOERROR)
@@ -88,7 +88,7 @@ void RageSoundDriver_WaveOut::SetupDecod
LOG->Warn( werr_ssprintf(GetLastError(), "Failed to set sound thread priority") );
}
-int64_t RageSoundDriver_WaveOut::GetPosition( const RageSoundBase *pSound ) const
+int64_t RageSoundDriver_WaveOut::GetPosition() const
{
MMTIME tm;
tm.wType = TIME_SAMPLES;
Index: RageSoundDriver_WaveOut.h
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -p -r1.20 -r1.21
--- RageSoundDriver_WaveOut.h 7 Dec 2006 02:16:51 -0000 1.20
+++ RageSoundDriver_WaveOut.h 13 Dec 2006 09:09:40 -0000 1.21
@@ -13,7 +13,7 @@ public:
~RageSoundDriver_WaveOut();
RString Init();
- int64_t GetPosition( const RageSoundBase *pSound ) const;
+ int64_t GetPosition() const;
float GetPlayLatency() const;
int GetSampleRate( int rate ) const { return m_iSampleRate; }
Index: RageSoundDriver_CA.h
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_CA.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -p -r1.34 -r1.35
--- RageSoundDriver_CA.h 7 Dec 2006 02:16:51 -0000 1.34
+++ RageSoundDriver_CA.h 13 Dec 2006 09:09:40 -0000 1.35
@@ -17,7 +17,7 @@ public:
~RageSoundDriver_CA();
float GetPlayLatency() const { return m_fLatency; }
int GetSampleRate( int rate ) const { return m_iSampleRate; }
- int64_t GetPosition( const RageSoundBase *sound ) const;
+ int64_t GetPosition() const;
void SetupDecodingThread();
private:
Index: RageSoundDriver_AU.h
===================================================================
RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_AU.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -p -r1.5 -r1.6
--- RageSoundDriver_AU.h 7 Dec 2006 02:16:51 -0000 1.5
+++ RageSoundDriver_AU.h 13 Dec 2006 09:09:40 -0000 1.6
@@ -13,7 +13,7 @@ public:
~RageSoundDriver_AU();
float GetPlayLatency() const;
int GetSampleRate( int rate ) const { return m_iSampleRate; }
- int64_t GetPosition( const RageSoundBase *sound ) const;
+ int64_t GetPosition() const;
protected:
void SetupDecodingThread();
|