mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Use bindable for track to fix rate adjustments not applying correctly
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Framework.Utils;
|
||||
@ -18,7 +19,11 @@ namespace osu.Game.Screens.Edit
|
||||
/// </summary>
|
||||
public class EditorClock : Component, IFrameBasedClock, IAdjustableClock, ISourceChangeableClock
|
||||
{
|
||||
public double TrackLength;
|
||||
public IBindable<Track> Track => track;
|
||||
|
||||
private readonly Bindable<Track> track = new Bindable<Track>();
|
||||
|
||||
public double TrackLength => track.Value?.Length ?? 60000;
|
||||
|
||||
public ControlPointInfo ControlPointInfo;
|
||||
|
||||
@ -36,7 +41,6 @@ namespace osu.Game.Screens.Edit
|
||||
this.beatDivisor = beatDivisor;
|
||||
|
||||
ControlPointInfo = controlPointInfo;
|
||||
TrackLength = trackLength;
|
||||
|
||||
underlyingClock = new DecoupleableInterpolatingFramedClock();
|
||||
}
|
||||
@ -193,8 +197,8 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
public void ChangeSource(IClock source)
|
||||
{
|
||||
track.Value = source as Track;
|
||||
underlyingClock.ChangeSource(source);
|
||||
TrackLength = (source as Track)?.Length ?? 60000;
|
||||
}
|
||||
|
||||
public IClock Source => underlyingClock.Source;
|
||||
|
Reference in New Issue
Block a user