![Crying or Very Sad :cry:](./images/smilies/icon_cry.gif)
GUI basically just a ListBox with SelectionMode = Multiple that updates when machines are added or deleted.
![Image](http://i.imgur.com/0bCwc0B.png)
Code: Select all
[MachineDecl(Name = "Jeskola MidiTest", ShortName = "MidiTest", Author = "Oskari Tammelin")]
public class MidiTestMachine : IBuzzMachine
{
IBuzzMachineHost host;
List<IMachine> targets = new List<IMachine>();
public MidiTestMachine(IBuzzMachineHost host)
{
this.host = host;
lock (targets) targets.Add(Global.Buzz.Song.Machines.FirstOrDefault(m => m.Name == "Qsamo"));
}
[ParameterDecl(DefValue = false)]
public bool Enabled { get; set; }
public void Work()
{
if (!Enabled) return;
if (host.MasterInfo.PosInTick == 0)
{
IMachine[] threadsafeTargets;
lock (targets) threadsafeTargets = targets.ToArray();
foreach (var t in threadsafeTargets)
{
if (t != null) t.SendMIDINote(0, 60, 100);
}
}
}
}
Yes, but you forgot to add Comments for the Retarded (TM).oskari wrote:There are GUI demos already (qsamo, relativion)
Thanks for the snippet. I'll keep plodding.but sending midi works like this:
Code: Select all
foreach (IMachine m in BuzzGUI.Common.Global.Buzz.Song.Machines)
Code: Select all
event Action<IMachine> MachineAdded;
event Action<IMachine> MachineRemoved;
Code: Select all
event Action<int> MIDIInput;