Cross Platform Application to allow control with a MIDI controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
708 B

// Author: Simon Gockner
// Created: 2021-04-10
// Copyright(c) 2021 SimonG. All Rights Reserved.
using Lib.Audio.Controls.Buttons.Interfaces;
using Lib.Driver.Xml;
namespace Lib.Audio.Controls.Buttons.Factories
{
public class ButtonFactory : IButtonFactory
{
public IButton Create(XmlButton xmlButton, int channelNumber)
{
if (xmlButton.ButtonType == "Select")
return new SelectButton(xmlButton.NoteNumber, channelNumber);
else if (xmlButton.ButtonType == "Mute")
return new MuteButton(xmlButton.NoteNumber, channelNumber);
return new Button(xmlButton.NoteNumber, channelNumber);
}
}
}