//============================== // ovrSoundLimiter::PlaySound void ovrSoundLimiter::PlaySoundEffect( OvrGuiSys & guiSys, char const * soundName, double const limitSeconds ) { double curTime = vrapi_GetTimeInSeconds(); double t = curTime - LastPlayTime; //LOG_WITH_TAG( "VrMenu", "PlaySoundEffect( '%s', %.2f ) - t == %.2f : %s", soundName, limitSeconds, t, t >= limitSeconds ? "PLAYING" : "SKIPPING" ); if ( t >= limitSeconds ) { guiSys.GetSoundEffectPlayer().Play( soundName ); LastPlayTime = curTime; } }
void ovrSoundLimiter::PlayMenuSound( OvrGuiSys & guiSys, char const * appendKey, char const * soundName, double const limitSeconds ) { char overrideSound[ 1024 ]; OVR_sprintf( overrideSound, 1024, "%s_%s", appendKey, soundName ); if ( guiSys.GetSoundEffectPlayer().Has( overrideSound ) ) { PlaySoundEffect( guiSys, overrideSound, limitSeconds ); } else { PlaySoundEffect( guiSys, soundName, limitSeconds ); } }