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

Adjust sample rate by UserPlaybackRate

This commit is contained in:
Ronnie Moir 2020-06-24 15:34:20 +01:00
parent 470d5bfce3
commit 4c28347686
2 changed files with 6 additions and 2 deletions

View File

@ -95,7 +95,7 @@ namespace osu.Game.Screens.Play
public bool LoadedBeatmapSuccessfully => DrawableRuleset?.Objects.Any() == true;
protected GameplayClockContainer GameplayClockContainer { get; private set; }
public GameplayClockContainer GameplayClockContainer { get; private set; }
public DimmableStoryboard DimmableStoryboard { get; private set; }

View File

@ -4,11 +4,13 @@
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Play;
namespace osu.Game.Storyboards.Drawables
{
@ -32,7 +34,7 @@ namespace osu.Game.Storyboards.Drawables
}
[BackgroundDependencyLoader]
private void load(IBindable<WorkingBeatmap> beatmap, IBindable<IReadOnlyList<Mod>> mods)
private void load(IBindable<WorkingBeatmap> beatmap, IBindable<IReadOnlyList<Mod>> mods, Player player)
{
Channel = beatmap.Value.Skin.GetSample(sampleInfo);
if (Channel == null)
@ -42,6 +44,8 @@ namespace osu.Game.Storyboards.Drawables
foreach (var mod in mods.Value.OfType<IApplicableToSample>())
mod.ApplyToSample(Channel);
Channel.AddAdjustment(AdjustableProperty.Frequency, player.GameplayClockContainer.UserPlaybackRate);
}
protected override void Update()