1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 07:22:54 +08:00

Rename Filter -> AudioFilter

This commit is contained in:
Dean Herbert 2021-10-07 18:49:30 +09:00
parent 0348c6c7e5
commit e578046b20
3 changed files with 14 additions and 12 deletions

View File

@ -15,13 +15,15 @@ using osu.Game.Graphics.UserInterface;
namespace osu.Game.Tests.Visual.Audio namespace osu.Game.Tests.Visual.Audio
{ {
public class TestSceneFilter : OsuTestScene public class TestSceneAudioFilter : OsuTestScene
{ {
private WorkingBeatmap testBeatmap; private WorkingBeatmap testBeatmap;
private OsuSpriteText lowpassText; private OsuSpriteText lowpassText;
private AudioFilter highpassFilter;
private AudioFilter lowpassFilter;
private OsuSpriteText highpassText; private OsuSpriteText highpassText;
private Filter lowpassFilter;
private Filter highpassFilter;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio) private void load(AudioManager audio)
@ -31,8 +33,8 @@ namespace osu.Game.Tests.Visual.Audio
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
lowpassFilter = new Filter(audio.TrackMixer), lowpassFilter = new AudioFilter(audio.TrackMixer),
highpassFilter = new Filter(audio.TrackMixer, BQFType.HighPass), highpassFilter = new AudioFilter(audio.TrackMixer, BQFType.HighPass),
lowpassText = new OsuSpriteText lowpassText = new OsuSpriteText
{ {
Padding = new MarginPadding(20), Padding = new MarginPadding(20),
@ -71,7 +73,7 @@ namespace osu.Game.Tests.Visual.Audio
[Test] [Test]
public void TestHighPass() => testFilter(highpassFilter, 0, AudioFilter.MAX_LOWPASS_CUTOFF); public void TestHighPass() => testFilter(highpassFilter, 0, AudioFilter.MAX_LOWPASS_CUTOFF);
private void testFilter(Filter filter, int cutoffFrom, int cutoffTo) private void testFilter(AudioFilter filter, int cutoffFrom, int cutoffTo)
{ {
AddStep("Load Track", () => testBeatmap.LoadTrack()); AddStep("Load Track", () => testBeatmap.LoadTrack());
AddStep("Play Track", () => testBeatmap.Track.Start()); AddStep("Play Track", () => testBeatmap.Track.Start());

View File

@ -9,7 +9,7 @@ using osu.Framework.Graphics;
namespace osu.Game.Audio.Effects namespace osu.Game.Audio.Effects
{ {
public class Filter : Component, ITransformableFilter public class AudioFilter : Component, ITransformableFilter
{ {
/// <summary> /// <summary>
/// The maximum cutoff frequency that can be used with a low-pass filter. /// The maximum cutoff frequency that can be used with a low-pass filter.
@ -31,7 +31,7 @@ namespace osu.Game.Audio.Effects
/// </summary> /// </summary>
/// <param name="mixer">The mixer this effect should be applied to.</param> /// <param name="mixer">The mixer this effect should be applied to.</param>
/// <param name="type">The type of filter (e.g. LowPass, HighPass, etc)</param> /// <param name="type">The type of filter (e.g. LowPass, HighPass, etc)</param>
public Filter(AudioMixer mixer, BQFType type = BQFType.LowPass) public AudioFilter(AudioMixer mixer, BQFType type = BQFType.LowPass)
{ {
this.mixer = mixer; this.mixer = mixer;
this.type = type; this.type = type;

View File

@ -21,7 +21,7 @@ namespace osu.Game.Overlays
protected override string PopInSampleName => "UI/dialog-pop-in"; protected override string PopInSampleName => "UI/dialog-pop-in";
protected override string PopOutSampleName => "UI/dialog-pop-out"; protected override string PopOutSampleName => "UI/dialog-pop-out";
private Filter lpFilter; private AudioFilter lowPassFilter;
public PopupDialog CurrentDialog { get; private set; } public PopupDialog CurrentDialog { get; private set; }
@ -42,7 +42,7 @@ namespace osu.Game.Overlays
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio) private void load(AudioManager audio)
{ {
AddInternal(lpFilter = new Filter(audio.TrackMixer)); AddInternal(lowPassFilter = new AudioFilter(audio.TrackMixer));
} }
public void Push(PopupDialog dialog) public void Push(PopupDialog dialog)
@ -82,14 +82,14 @@ namespace osu.Game.Overlays
{ {
base.PopIn(); base.PopIn();
this.FadeIn(PopupDialog.ENTER_DURATION, Easing.OutQuint); this.FadeIn(PopupDialog.ENTER_DURATION, Easing.OutQuint);
lpFilter.CutoffTo(300, 100, Easing.OutCubic); lowPassFilter.CutoffTo(300, 100, Easing.OutCubic);
} }
protected override void PopOut() protected override void PopOut()
{ {
base.PopOut(); base.PopOut();
lpFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF, 100, Easing.InCubic); lowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF, 100, Easing.InCubic);
if (CurrentDialog?.State.Value == Visibility.Visible) if (CurrentDialog?.State.Value == Visibility.Visible)
{ {