using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.Instruments.UI;
///
/// A type of to be added to the for displaying and handling
/// all necessary controls regarding a certain type of MIDI input (i.e.: Files, Bands, Hardware input).
/// Must be initialized and registered to the menu inside .
///
[GenerateTypedNameReferences]
public abstract partial class InstrumentMidiSourceBase : BoxContainer
{
///
/// The string to display for the button on the left side of the instrument UI.
///
public virtual string ButtonName { get; } = Loc.GetString("instruments-component-menu-unknown-midi-source-button");
///
/// Returns true if this source is currently the active one.
///
protected bool Enabled { get; private set; }
protected InstrumentMidiSourceBase()
{
RobustXamlLoader.Load(this);
}
///
/// Override if the source requires additional handling to become enabled.
/// i.e.: Opening MIDI-Input.
///
[MustCallBase]
public virtual void Enable()
{
Visible = true;
Enabled = true;
}
///
/// Override if the source requires additional handling on being disabled.
/// i.e.: Closing MIDI-Input.
///
[MustCallBase]
public virtual void Disable()
{
Enabled = false;
Visible = false;
}
}