using Newtonsoft.Json; using RhythmBase.Components; using RhythmBase.Converters; namespace RhythmBase.Events { /// /// Represents an event to set the game sound. /// public partial class SetGameSound : BaseEvent { /// /// Initializes a new instance of the class. /// public SetGameSound() { Audio = new RDAudio(); Type = EventType.SetGameSound; Tab = Tabs.Sounds; } /// /// Gets or sets the audio associated with the event. /// [JsonIgnore] private RDAudio Audio { get; set; } /// /// Gets or sets the type of the sound. /// public SoundTypes SoundType { get; set; } /// /// Gets or sets the filename of the audio. /// public string Filename { get => Audio.Filename; set => Audio.Filename = value; } /// /// Gets or sets the volume of the audio. /// public int Volume { get => Audio.Volume; set => Audio.Volume = value; } /// /// Gets or sets the pitch of the audio. /// public int Pitch { get => Audio.Pitch; set => Audio.Pitch = value; } /// /// Gets or sets the pan of the audio. /// public int Pan { get => Audio.Pan; set => Audio.Pan = value; } /// /// Gets or sets the offset time of the audio. /// [JsonConverter(typeof(MilliSecondConverter))] public TimeSpan Offset { get => Audio.Offset; set => Audio.Offset = value; } /// /// Gets or sets the list of sound subtypes. /// public List SoundSubtypes { 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(" {0}", SoundType); } }