Skip to content

Commit

Permalink
Change IApplicableToSample to receive adjustable component instead
Browse files Browse the repository at this point in the history
Done for consistency with `IApplicableToTrack`.
  • Loading branch information
frenzibyte committed May 10, 2022
1 parent 4f50017 commit 82b784c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions osu.Game/Rulesets/Mods/IApplicableToSample.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Graphics.Audio;
using osu.Framework.Audio;

namespace osu.Game.Rulesets.Mods
{
Expand All @@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Mods
/// </summary>
public interface IApplicableToSample : IApplicableMod
{
void ApplyToSample(DrawableSample sample);
void ApplyToSample(IAdjustableAudioComponent sample);
}
}
3 changes: 1 addition & 2 deletions osu.Game/Rulesets/Mods/ModAdaptiveSpeed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Linq;
using osu.Framework.Audio;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Audio;
using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
Expand Down Expand Up @@ -150,7 +149,7 @@ public void ApplyToTrack(IAdjustableAudioComponent track)
recentRates.AddRange(Enumerable.Repeat(InitialRate.Value, recent_rate_count));
}

public void ApplyToSample(DrawableSample sample)
public void ApplyToSample(IAdjustableAudioComponent sample)
{
sample.AddAdjustment(AdjustableProperty.Frequency, SpeedChange);
}
Expand Down
3 changes: 1 addition & 2 deletions osu.Game/Rulesets/Mods/ModRateAdjust.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using osu.Framework.Audio;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Audio;

namespace osu.Game.Rulesets.Mods
{
Expand All @@ -19,7 +18,7 @@ public virtual void ApplyToTrack(IAdjustableAudioComponent track)
track.AddAdjustment(AdjustableProperty.Tempo, SpeedChange);
}

public virtual void ApplyToSample(DrawableSample sample)
public virtual void ApplyToSample(IAdjustableAudioComponent sample)
{
sample.AddAdjustment(AdjustableProperty.Frequency, SpeedChange);
}
Expand Down
3 changes: 1 addition & 2 deletions osu.Game/Rulesets/Mods/ModTimeRamp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Linq;
using osu.Framework.Audio;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Audio;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Rulesets.Objects;
Expand Down Expand Up @@ -62,7 +61,7 @@ public void ApplyToTrack(IAdjustableAudioComponent track)
AdjustPitch.TriggerChange();
}

public void ApplyToSample(DrawableSample sample)
public void ApplyToSample(IAdjustableAudioComponent sample)
{
sample.AddAdjustment(AdjustableProperty.Frequency, SpeedChange);
}
Expand Down

0 comments on commit 82b784c

Please sign in to comment.