using System.Diagnostics;
namespace RhythmBase.Events
{
///
/// Represents an event to add a one-shot beat.
///
[DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(),nq}}")]
public class AddOneshotBeat : BaseBeat
{
///
/// Initializes a new instance of the class.
///
public AddOneshotBeat() { }
///
/// Gets or sets the type of pulse.
///
public Pulse PulseType { get; set; }
///
/// Gets or sets the number of subdivisions.
///
public byte Subdivisions { get; set; } = 1;
///
/// Gets or sets a value indicating whether the subdivision sound is enabled.
///
public bool SubdivSound { get; set; }
///
/// Gets or sets the tick value.
///
public float Tick { get; set; }
///
/// Gets or sets the number of loops.
///
public uint Loops { get; set; }
///
/// Gets or sets the interval value.
///
public float Interval { get; set; }
///
/// Gets or sets a value indicating whether to skip the shot.
///
public bool Skipshot { get; set; }
///
/// Gets or sets the freeze burn mode.
///
public FreezeBurn? FreezeBurnMode { get; set; }
///
/// Gets or sets the delay value.
///
public float Delay
{
get => _delay;
set => _delay = FreezeBurnMode != FreezeBurn.Freezeshot
? 0f : value <= 0f
? 0.5f : value;
}
///
public override EventType Type { get; } = EventType.AddOneshotBeat;
///
public override string ToString() => base.ToString() + $" {FreezeBurnMode} {PulseType}";
private float _delay = 0f;
///
/// Represents the type of pulse.
///
///
/// The pulse type determines the shape of the beat's waveform.
///
public enum Pulse
{
///
/// A wave pulse.
///
Wave,
///
/// A square pulse.
///
Square,
///
/// A triangle pulse.
///
Triangle,
///
/// A heart-shaped pulse.
///
Heart
}
///
/// Represents the freeze burn mode.
///
///
/// The freeze burn mode determines the effect applied to the beat.
///
public enum FreezeBurn
{
///
/// A wave freeze burn mode.
///
Wave,
///
/// A freeze shot mode.
///
Freezeshot,
///
/// A burn shot mode.
///
Burnshot
}
private string GetDebuggerDisplay() => ToString();
}
}