1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 20:32:55 +08:00

Merge pull request #12080 from peppy/add-25-playback-editor

Change editor speed adjust to adjust frequency (and restore 25% option)
This commit is contained in:
Dan Balasescu 2021-03-19 21:04:12 +09:00 committed by GitHub
commit e72205eea2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ namespace osu.Game.Screens.Edit.Components
[Resolved] [Resolved]
private EditorClock editorClock { get; set; } private EditorClock editorClock { get; set; }
private readonly BindableNumber<double> tempo = new BindableDouble(1); private readonly BindableNumber<double> freqAdjust = new BindableDouble(1);
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
@ -58,16 +58,16 @@ namespace osu.Game.Screens.Edit.Components
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Height = 0.5f, Height = 0.5f,
Padding = new MarginPadding { Left = 45 }, Padding = new MarginPadding { Left = 45 },
Child = new PlaybackTabControl { Current = tempo }, Child = new PlaybackTabControl { Current = freqAdjust },
} }
}; };
Track.BindValueChanged(tr => tr.NewValue?.AddAdjustment(AdjustableProperty.Tempo, tempo), true); Track.BindValueChanged(tr => tr.NewValue?.AddAdjustment(AdjustableProperty.Frequency, freqAdjust), true);
} }
protected override void Dispose(bool isDisposing) protected override void Dispose(bool isDisposing)
{ {
Track.Value?.RemoveAdjustment(AdjustableProperty.Tempo, tempo); Track.Value?.RemoveAdjustment(AdjustableProperty.Frequency, freqAdjust);
base.Dispose(isDisposing); base.Dispose(isDisposing);
} }
@ -101,7 +101,7 @@ namespace osu.Game.Screens.Edit.Components
private class PlaybackTabControl : OsuTabControl<double> private class PlaybackTabControl : OsuTabControl<double>
{ {
private static readonly double[] tempo_values = { 0.5, 0.75, 1 }; private static readonly double[] tempo_values = { 0.25, 0.5, 0.75, 1 };
protected override TabItem<double> CreateTabItem(double value) => new PlaybackTabItem(value); protected override TabItem<double> CreateTabItem(double value) => new PlaybackTabItem(value);