mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:52:55 +08:00
Remove generics from IApplicableToTrack
This commit is contained in:
parent
c8ebbc8594
commit
7c3ae4ed42
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Audio;
|
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mods
|
namespace osu.Game.Rulesets.Mods
|
||||||
@ -11,6 +10,6 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IApplicableToTrack : IApplicableMod
|
public interface IApplicableToTrack : IApplicableMod
|
||||||
{
|
{
|
||||||
void ApplyToTrack<T>(T track) where T : class, ITrack, IAdjustableAudioComponent;
|
void ApplyToTrack(ITrack track);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Audio.Track;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
|
||||||
@ -26,11 +27,11 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ApplyToTrack<T>(T track)
|
public override void ApplyToTrack(ITrack track)
|
||||||
{
|
{
|
||||||
// base.ApplyToTrack() intentionally not called (different tempo adjustment is applied)
|
// base.ApplyToTrack() intentionally not called (different tempo adjustment is applied)
|
||||||
track.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
|
(track as IAdjustableAudioComponent)?.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
|
||||||
track.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
|
(track as IAdjustableAudioComponent)?.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,11 +38,11 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ApplyToTrack<T>(T track)
|
public override void ApplyToTrack(ITrack track)
|
||||||
{
|
{
|
||||||
// base.ApplyToTrack() intentionally not called (different tempo adjustment is applied)
|
// base.ApplyToTrack() intentionally not called (different tempo adjustment is applied)
|
||||||
track.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
|
(track as IAdjustableAudioComponent)?.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
|
||||||
track.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
|
(track as IAdjustableAudioComponent)?.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyToDrawableRuleset(DrawableRuleset<TObject> drawableRuleset)
|
public void ApplyToDrawableRuleset(DrawableRuleset<TObject> drawableRuleset)
|
||||||
|
@ -12,10 +12,9 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
{
|
{
|
||||||
public abstract BindableNumber<double> SpeedChange { get; }
|
public abstract BindableNumber<double> SpeedChange { get; }
|
||||||
|
|
||||||
public virtual void ApplyToTrack<T>(T track)
|
public virtual void ApplyToTrack(ITrack track)
|
||||||
where T : class, ITrack, IAdjustableAudioComponent
|
|
||||||
{
|
{
|
||||||
track.AddAdjustment(AdjustableProperty.Tempo, SpeedChange);
|
(track as IAdjustableAudioComponent)?.AddAdjustment(AdjustableProperty.Tempo, SpeedChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void ApplyToSample(SampleChannel sample)
|
public virtual void ApplyToSample(SampleChannel sample)
|
||||||
|
@ -51,8 +51,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
AdjustPitch.BindValueChanged(applyPitchAdjustment);
|
AdjustPitch.BindValueChanged(applyPitchAdjustment);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyToTrack<T>(T track)
|
public void ApplyToTrack(ITrack track)
|
||||||
where T : class, ITrack, IAdjustableAudioComponent
|
|
||||||
{
|
{
|
||||||
this.track = track;
|
this.track = track;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user