Change IApplicableToTrack to receive adjustable component instead

This commit is contained in:
Salman Ahmed
2022-05-10 18:01:15 +03:00
parent bbbecbb6b7
commit 4f5001704e
7 changed files with 10 additions and 16 deletions

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Audio;
using osu.Framework.Utils;
@ -79,7 +78,7 @@ namespace osu.Game.Rulesets.Mods
// Apply a fixed rate change when missing, allowing the player to catch up when the rate is too fast.
private const double rate_change_on_miss = 0.95d;
private ITrack track;
private IAdjustableAudioComponent track;
private double targetRate = 1d;
/// <summary>
@ -141,7 +140,7 @@ namespace osu.Game.Rulesets.Mods
AdjustPitch.BindValueChanged(adjustPitchChanged);
}
public void ApplyToTrack(ITrack track)
public void ApplyToTrack(IAdjustableAudioComponent track)
{
this.track = track;
@ -210,7 +209,6 @@ namespace osu.Game.Rulesets.Mods
private void adjustPitchChanged(ValueChangedEvent<bool> adjustPitchSetting)
{
track?.RemoveAdjustment(adjustmentForPitchSetting(adjustPitchSetting.OldValue), SpeedChange);
track?.AddAdjustment(adjustmentForPitchSetting(adjustPitchSetting.NewValue), SpeedChange);
}