mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 09:12:54 +08:00
Fix low pass filter sometimes not applied in dialog overlays
This commit is contained in:
parent
1668048fb7
commit
77b00dac7e
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
@ -71,7 +72,7 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
Progress.BindValueChanged(progressChanged);
|
Progress.BindValueChanged(progressChanged, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void AbortConfirm()
|
protected override void AbortConfirm()
|
||||||
@ -122,11 +123,13 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
|
|
||||||
private void progressChanged(ValueChangedEvent<double> progress)
|
private void progressChanged(ValueChangedEvent<double> progress)
|
||||||
{
|
{
|
||||||
if (progress.NewValue < progress.OldValue) return;
|
lowPassFilter.Cutoff = Math.Max(1, (int)(progress.NewValue * AudioFilter.MAX_LOWPASS_CUTOFF * 0.5));
|
||||||
|
|
||||||
if (Clock.CurrentTime - lastTickPlaybackTime < 30) return;
|
if (progress.NewValue < progress.OldValue)
|
||||||
|
return;
|
||||||
|
|
||||||
lowPassFilter.CutoffTo((int)(progress.NewValue * AudioFilter.MAX_LOWPASS_CUTOFF * 0.5));
|
if (Clock.CurrentTime - lastTickPlaybackTime < 30)
|
||||||
|
return;
|
||||||
|
|
||||||
var channel = tickSample.GetChannel();
|
var channel = tickSample.GetChannel();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user