diff --git a/osu.Game/Audio/PreviewTrack.cs b/osu.Game/Audio/PreviewTrack.cs
index 59baa86f80..5fd3dbfe8f 100644
--- a/osu.Game/Audio/PreviewTrack.cs
+++ b/osu.Game/Audio/PreviewTrack.cs
@@ -11,7 +11,14 @@ namespace osu.Game.Audio
{
public abstract class PreviewTrack : Component
{
+ ///
+ /// Invoked when this has stopped playing.
+ ///
public event Action Stopped;
+
+ ///
+ /// Invoked when this has started playing.
+ ///
public event Action Started;
private Track track;
@@ -52,6 +59,9 @@ namespace osu.Game.Audio
private ScheduledDelegate startDelegate;
+ ///
+ /// Starts playing this .
+ ///
public void Start() => startDelegate = Schedule(() =>
{
if (!IsLoaded)
@@ -68,6 +78,9 @@ namespace osu.Game.Audio
Started?.Invoke();
});
+ ///
+ /// Stops playing this .
+ ///
public void Stop()
{
startDelegate?.Cancel();
@@ -86,6 +99,9 @@ namespace osu.Game.Audio
Stopped?.Invoke();
}
+ ///
+ /// Retrieves the audio track.
+ ///
protected abstract Track GetTrack();
}
}
diff --git a/osu.Game/Audio/PreviewTrackManager.cs b/osu.Game/Audio/PreviewTrackManager.cs
index 499e4a1eea..8febf8e621 100644
--- a/osu.Game/Audio/PreviewTrackManager.cs
+++ b/osu.Game/Audio/PreviewTrackManager.cs
@@ -11,6 +11,9 @@ using osu.Game.Beatmaps;
namespace osu.Game.Audio
{
+ ///
+ /// A central store for the retrieval of s.
+ ///
public class PreviewTrackManager : Component
{
private readonly BindableDouble muteBindable = new BindableDouble();
@@ -31,6 +34,11 @@ namespace osu.Game.Audio
config.BindWith(FrameworkSetting.VolumeMusic, trackManager.Volume);
}
+ ///
+ /// Retrieves a for a .
+ ///
+ /// The to retrieve the preview track for.
+ /// The playable .
public PreviewTrack Get(BeatmapSetInfo beatmapSetInfo)
{
var track = new TrackManagerPreviewTrack(beatmapSetInfo, trackManager);
@@ -51,6 +59,15 @@ namespace osu.Game.Audio
return track;
}
+ ///
+ /// Stops the currently playing .
+ ///
+ ///
+ /// Only the immediate owner (an object that implements ) of the playing
+ /// can globally stop the currently playing . The object holding a reference to the
+ /// can always stop the themselves through .
+ ///
+ /// The which may be the owner of the .
public void Stop(IPreviewTrackOwner source)
{
if (current?.Owner != source)