From 322ebd5baab6fcd062d54b5fb4b35491913d18cd Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 27 Jan 2007 07:32:13 +0000 Subject: [PATCH] remove RageSound::GetAbsoluteVolume; use "Volume" property instead --- stepmania/src/RageSound.cpp | 11 ++++------- stepmania/src/RageSound.h | 2 -- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index d9951b596e..36fba986b6 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -564,13 +564,6 @@ bool RageSound::SetPositionFrames( int iFrames ) return iRet == 1; } -float RageSound::GetAbsoluteVolume() const -{ - float f = m_Param.m_Volume; - f *= SOUNDMAN->GetMixVolume(); - return f; -} - float RageSound::GetPlaybackRate() const { return m_Param.m_fSpeed; @@ -597,6 +590,10 @@ void RageSound::ApplyParams() m_pSource->SetProperty( "StartSecond", m_Param.m_StartSecond ); m_pSource->SetProperty( "LengthSeconds", m_Param.m_LengthSeconds ); m_pSource->SetProperty( "FadeSeconds", m_Param.m_FadeLength ); + + float fVolume = m_Param.m_Volume * SOUNDMAN->GetMixVolume(); + m_pSource->SetProperty( "Volume", fVolume ); + switch( GetStopMode() ) { case RageSoundParams::M_LOOP: diff --git a/stepmania/src/RageSound.h b/stepmania/src/RageSound.h index 93a1c7abbb..66c340452a 100644 --- a/stepmania/src/RageSound.h +++ b/stepmania/src/RageSound.h @@ -20,7 +20,6 @@ public: virtual void CommitPlayingPosition( int64_t iFrameno, int64_t iPosition, int iBytesRead ) = 0; virtual int GetSampleRate() const = 0; virtual RageTimer GetStartTime() const { return RageZeroTimer; } - virtual float GetAbsoluteVolume() const = 0; virtual RString GetLoadedFilePath() const = 0; }; @@ -139,7 +138,6 @@ public: float GetPlaybackRate() const; RageTimer GetStartTime() const; - float GetAbsoluteVolume() const; // factors in SOUNDMAN->GetMixVolume() void SetParams( const RageSoundParams &p ); const RageSoundParams &GetParams() const { return m_Param; } bool SetProperty( const RString &sProperty, float fValue );