From a7d3a539ee004e566955b8f5ed35681770d6ec95 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 22 Dec 2006 06:06:57 +0000 Subject: [PATCH] fixup (still unused) code --- stepmania/src/RageSoundReader_Chain.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/stepmania/src/RageSoundReader_Chain.cpp b/stepmania/src/RageSoundReader_Chain.cpp index d512c2d8f6..f69e87d2f3 100644 --- a/stepmania/src/RageSoundReader_Chain.cpp +++ b/stepmania/src/RageSoundReader_Chain.cpp @@ -274,11 +274,17 @@ bool RageSoundReader_Chain::SetProperty( const RString &sProperty, float fValue int RageSoundReader_Chain::GetNextSourceFrame() const { return m_iCurrentFrame; - // XXX: GetPosition is expected to differ by iOffsetMS -/* int iPosition = m_apActiveSounds[0].pSound->GetPosition(); - for( unsigned i = 1; i < m_apActiveSounds.size(); ) +/* if( m_apActiveSounds.empty() ) + return m_iCurrentFrame; + + int iPosition = m_apActiveSounds[0]->pSound->GetNextSourceFrame(); + iPosition += m_apActiveSounds[0]->GetOffsetFrame( GetSampleRate() ); + + for( unsigned i = 1; i < m_apActiveSounds.size(); ++i ) { - if( m_apActiveSounds[i].pSound->GetPosition() != iPosition ) + int iThisPosition = m_apActiveSounds[i]->pSound->GetNextSourceFrame(); + iThisPosition += m_apActiveSounds[i]->GetOffsetFrame( GetSampleRate() ); + if( iThisPosition != iPosition ) LOG->Warn( "RageSoundReader_Chain: sound positions moving at different rates" ); }