1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 09:32:55 +08:00

Pin DC/NC pitch

This commit is contained in:
Dean Herbert 2019-12-09 20:40:38 +09:00
parent edc8220554
commit 12bdb1dafd
2 changed files with 24 additions and 2 deletions

View File

@ -3,6 +3,7 @@
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Rulesets.Mods
@ -14,9 +15,19 @@ namespace osu.Game.Rulesets.Mods
public override IconUsage Icon => FontAwesome.Solid.Question;
public override string Description => "Whoaaaaa...";
private readonly BindableNumber<double> tempoAdjust = new BindableDouble(1);
private readonly BindableNumber<double> freqAdjust = new BindableDouble(1);
public override void ApplyToTrack(Track track)
{
track.AddAdjustment(AdjustableProperty.Frequency, SpeedChange);
track.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
track.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
SpeedChange.BindValueChanged(val =>
{
freqAdjust.Value = SpeedChange.Default;
tempoAdjust.Value = val.NewValue / SpeedChange.Default;
}, true);
}
}
}

View File

@ -3,6 +3,7 @@
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
@ -15,9 +16,19 @@ namespace osu.Game.Rulesets.Mods
public override IconUsage Icon => OsuIcon.ModNightcore;
public override string Description => "Uguuuuuuuu...";
private readonly BindableNumber<double> tempoAdjust = new BindableDouble(1);
private readonly BindableNumber<double> freqAdjust = new BindableDouble(1);
public override void ApplyToTrack(Track track)
{
track.AddAdjustment(AdjustableProperty.Frequency, SpeedChange);
track.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
track.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
SpeedChange.BindValueChanged(val =>
{
freqAdjust.Value = SpeedChange.Default;
tempoAdjust.Value = val.NewValue / SpeedChange.Default;
}, true);
}
}
}