using Newtonsoft.Json;
using RhythmBase.Components;
namespace RhythmBase.Events
{
///
/// Represents an event to play a song with specific beats per minute and other properties.
///
public class PlaySong : BaseBeatsPerMinute, IBarBeginningEvent
{
///
/// Initializes a new instance of the class.
///
public PlaySong()
{
Type = EventType.PlaySong;
Tab = Tabs.Sounds;
}
///
/// Gets or sets the beats per minute (BPM) for the song.
///
[JsonProperty("bpm")]
public override float BeatsPerMinute
{
get => base.BeatsPerMinute;
set => base.BeatsPerMinute = value;
}
///
/// Gets or sets the offset time for the song.
///
[JsonIgnore]
public TimeSpan Offset
{
get => Song.Offset;
set => Song.Offset = value;
}
///
/// Gets or sets a value indicating whether the song should loop.
///
public bool Loop { get; set; }
///
/// Gets the type of the event.
///
public override EventType Type { get; }
///
/// Gets the tab associated with the event.
///
public override Tabs Tab { get; }
///
/// Returns a string that represents the current object.
///
/// A string that represents the current object.
public override string ToString() => base.ToString() + string.Format(" BPM:{0}, Song:{1}", BeatsPerMinute, Song.Filename);
///
/// Gets or sets the song to be played.
///
public RDAudio Song = new();
}
}