1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Clear cached waveform on track change in editor

This commit is contained in:
ansel 2022-12-22 01:23:24 +03:00
parent d81a724dd7
commit 66a02374da
2 changed files with 8 additions and 2 deletions

View File

@ -48,7 +48,7 @@ namespace osu.Game.Beatmaps
private readonly object beatmapFetchLock = new object();
private readonly Lazy<Waveform> waveform;
private Lazy<Waveform> waveform;
private readonly Lazy<Storyboard> storyboard;
private readonly Lazy<ISkin> skin;
private Track track; // track is not Lazy as we allow transferring and loading multiple times.
@ -329,6 +329,12 @@ namespace osu.Game.Beatmaps
#endregion
public void InvalidateWaveform()
{
if (waveform.IsValueCreated)
waveform = new Lazy<Waveform>(GetWaveform);
}
public override string ToString() => BeatmapInfo.ToString();
public abstract Stream GetStream(string storagePath);

View File

@ -118,7 +118,7 @@ namespace osu.Game.Screens.Edit.Setup
}
working.Value.Metadata.AudioFile = destination.Name;
working.Value.InvalidateWaveform();
editorBeatmap.SaveState();
music.ReloadCurrentTrack();