/// <summary> /// Constructor creates the virual grid for the XY hardware. /// </summary> public MidiXYHardwareInterface(MappedMidiDevice mapping) : base(mapping) { CreateMappers(); Grid = new VirtualGrid((int x, int y, int value) => { if (XYMapper == null) { return(null); } if (mapping == null) { return(null); } // TODO: gonna need to tell the virtual grid to refresh whenever the mapping changes! MidiMessage msg = new MidiMessage(); if (XYMapper.ConvertXY(x, y, out msg.Type, out msg.Number)) { msg.Velocity = value; msg.LogSource(LastSourceName); return(new MidiIndicatorAction() { Driver = mapping.Driver, Message = msg }.ScheduleTask()); } return(null); }, 64, 64, 9, 9); // TODO: maybe have more reasonable defaults? }
private void Awake() { mTarget = (VirtualGrid)target; //mTarget.InitData(); }