1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00
osu-lazer/osu.Game/Audio/PreviewTrack.cs

37 lines
828 B
C#
Raw Normal View History

2018-05-25 05:37:53 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Audio.Track;
2018-06-02 02:06:37 +08:00
using osu.Framework.Graphics.Containers;
2018-05-25 05:37:53 +08:00
namespace osu.Game.Audio
{
public class PreviewTrack
{
public readonly Track Track;
2018-06-02 02:06:37 +08:00
public readonly OverlayContainer Owner;
2018-05-25 05:37:53 +08:00
public event Action Stopped;
public event Action Started;
public PreviewTrack(Track track, OverlayContainer owner)
2018-05-25 05:37:53 +08:00
{
Track = track;
2018-06-02 02:06:37 +08:00
Owner = owner;
2018-05-25 05:37:53 +08:00
}
public void Start()
{
Track.Restart();
Started?.Invoke();
}
public void Stop()
{
Track.Stop();
Stopped?.Invoke();
}
}
}