mirror of https://github.com/ppy/osu
Invalidate waveform on track load
This commit is contained in:
parent
d0645ce151
commit
20370bd5ae
|
@ -105,7 +105,14 @@ public void CancelAsyncLoad()
|
|||
|
||||
public virtual bool TrackLoaded => track != null;
|
||||
|
||||
public Track LoadTrack() => track = GetBeatmapTrack() ?? GetVirtualTrack(1000);
|
||||
public Track LoadTrack()
|
||||
{
|
||||
// track could be changed, clearing waveform cache
|
||||
waveform = null;
|
||||
|
||||
track = GetBeatmapTrack() ?? GetVirtualTrack(1000);
|
||||
return track;
|
||||
}
|
||||
|
||||
public void PrepareTrackForPreview(bool looping, double offsetFromPreviewPoint = 0)
|
||||
{
|
||||
|
@ -172,12 +179,6 @@ protected Track GetVirtualTrack(double emptyLength = 0)
|
|||
|
||||
public Waveform Waveform => waveform ??= GetWaveform();
|
||||
|
||||
/// <summary>
|
||||
/// Reloads waveform of beatmap's track even if one is already cached.
|
||||
/// </summary>
|
||||
/// <returns>Newly loaded waveform.</returns>
|
||||
public Waveform LoadWaveform() => waveform = GetWaveform();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Beatmap
|
||||
|
|
|
@ -118,7 +118,7 @@ public bool ChangeAudioTrack(FileInfo source)
|
|||
}
|
||||
|
||||
working.Value.Metadata.AudioFile = destination.Name;
|
||||
working.Value.LoadWaveform();
|
||||
|
||||
editorBeatmap.SaveState();
|
||||
music.ReloadCurrentTrack();
|
||||
|
||||
|
|
Loading…
Reference in New Issue