// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using System.IO; using System.Threading; using osu.Framework.Audio.Track; using osu.Framework.Graphics.Textures; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.UI; using osu.Game.Skinning; using osu.Game.Storyboards; namespace osu.Game.Beatmaps { public interface IWorkingBeatmap { IBeatmapInfo BeatmapInfo { get; } IBeatmapSetInfo BeatmapSetInfo { get; } IBeatmapMetadataInfo Metadata { get; } /// /// Whether the Beatmap has finished loading. /// public bool BeatmapLoaded { get; } /// /// Whether the Background has finished loading. /// public bool BackgroundLoaded { get; } /// /// Whether the Waveform has finished loading. /// public bool WaveformLoaded { get; } /// /// Whether the Storyboard has finished loading. /// public bool StoryboardLoaded { get; } /// /// Whether the Skin has finished loading. /// public bool SkinLoaded { get; } /// /// Whether the Track has finished loading. /// public bool TrackLoaded { get; } /// /// Retrieves the which this represents. /// IBeatmap Beatmap { get; } /// /// Retrieves the background for this . /// Texture Background { get; } /// /// Retrieves the for the of this . /// Waveform Waveform { get; } /// /// Retrieves the which this provides. /// Storyboard Storyboard { get; } /// /// Retrieves the which this provides. /// ISkin Skin { get; } /// /// Retrieves the which this has loaded. /// Track Track { get; } /// /// Constructs a playable from using the applicable converters for a specific . /// /// The returned is in a playable state - all and s /// have been applied, and s have been fully constructed. /// /// /// The to create a playable for. /// The s to apply to the . /// Cancellation token that cancels the beatmap loading process. /// The converted . /// If could not be converted to . IBeatmap GetPlayableBeatmap(RulesetInfo ruleset, IReadOnlyList mods = null, CancellationToken token = default); /// /// Load a new audio track instance for this beatmap. This should be called once before accessing . /// The caller of this method is responsible for the lifetime of the track. /// /// /// In a standard game context, the loading of the track is managed solely by MusicController, which will /// automatically load the track of the current global IBindable IWorkingBeatmap. /// As such, this method should only be called in very special scenarios, such as external tests or apps which are /// outside of the game context. /// /// A fresh track instance, which will also be available via . Track LoadTrack(); /// /// Returns the stream of the file from the given storage path. /// /// The storage path to the file. Stream GetStream(string storagePath); /// /// Beings loading the contents of this asynchronously. /// public void BeginAsyncLoad(); /// /// Cancels the asynchronous loading of the contents of this . /// public void CancelAsyncLoad(); /// /// Reads the correct track restart point from beatmap metadata and sets looping to enabled. /// void PrepareTrackForPreviewLooping(); } }