[Player] Make keysounds respect volume preference. Fixes issue 344.
This commit is contained in:
+4
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user