[Player] Make keysounds respect volume preference. Fixes issue 344.

This commit is contained in:
AJ Kelly
2011-08-20 03:03:10 -05:00
parent 3fdf6958ce
commit 0c40652436
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -1403,6 +1403,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
if( tn.iKeysoundIndex >= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() )
{
float factor = (tn.subType == TapNote::hold_head_roll ? 2.0 * fLifeFraction : 10.0f * fLifeFraction - 8.5f);
// todo: Make sure the player's volume settings are respected. -aj
m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", max(0.0f, min(1.0f, factor)));
}
}
@@ -1939,7 +1940,9 @@ void Player::PlayKeysound( const TapNote &tn, TapNoteScore score )
}
}
m_vKeysounds[tn.iKeysoundIndex].Play();
m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", 1);
Preference<float> *pVolume = Preference<float>::GetPreferenceByName("SoundVolume");
float fVol = pVolume->Get();
m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", fVol);
}
}