1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 21:27:24 +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
{
public class TestSceneFilter : OsuTestScene
public class TestSceneAudioFilter : OsuTestScene
{
private WorkingBeatmap testBeatmap;
private OsuSpriteText lowpassText;
private AudioFilter highpassFilter;
private AudioFilter lowpassFilter;
private OsuSpriteText highpassText;
private Filter lowpassFilter;
private Filter highpassFilter;
[BackgroundDependencyLoader]
private void load(AudioManager audio)
@ -31,8 +33,8 @@ namespace osu.Game.Tests.Visual.Audio
{
Children = new Drawable[]
{
lowpassFilter = new Filter(audio.TrackMixer),
highpassFilter = new Filter(audio.TrackMixer, BQFType.HighPass),
lowpassFilter = new AudioFilter(audio.TrackMixer),
highpassFilter = new AudioFilter(audio.TrackMixer, BQFType.HighPass),
lowpassText = new OsuSpriteText
{
Padding = new MarginPadding(20),
@ -71,7 +73,7 @@ namespace osu.Game.Tests.Visual.Audio
[Test]
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("Play Track", () => testBeatmap.Track.Start());

View File

@ -9,7 +9,7 @@ using osu.Framework.Graphics;
namespace osu.Game.Audio.Effects
{
public class Filter : Component, ITransformableFilter
public class AudioFilter : Component, ITransformableFilter
{
/// <summary>
/// The maximum cutoff frequency that can be used with a low-pass filter.
@ -31,7 +31,7 @@ namespace osu.Game.Audio.Effects
/// </summary>
/// <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>
public Filter(AudioMixer mixer, BQFType type = BQFType.LowPass)
public AudioFilter(AudioMixer mixer, BQFType type = BQFType.LowPass)
{
this.mixer = mixer;
this.type = type;

View File

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