internal override void Elapse(ElapseData data)
{
try
{
this.Api.Elapse(data);
/*
* Process the sounds.
* */
for (int i = 0; i < this.SoundCount; i++)
{
if (this.Sounds[i].Playing || !SoundManager.IsPlaying(this.Sounds[i].SoundSourceIndex))
{
SoundManager.StopSound(ref this.Sounds[i].SoundSourceIndex);
this.Sounds[i].Stop();
this.Sounds[i] = this.Sounds[this.SoundCount - 1];
this.SoundCount--;
i--;
}
else
{
double pitch = Math.Max(0.01, this.Sounds[i].Pitch);
double volume = Math.Max(0.0, this.Sounds[i].Volume);
SoundManager.ModulateSound(this.Sounds[i].SoundSourceIndex, pitch, volume);
}
}
}
catch (Exception ex)
{
base.LastException = ex;
throw;
}
}