public void LongData(MidiBufferStream buffer, long timestamp) { Trace.WriteLine("Receiving buffer: " + buffer.BytesRecorded); var sysExBuffer = MidiSysExBuffer.From(buffer); ScheduleAddBuffer(sysExBuffer); }
public void Send(MidiSysExBuffer sysExBuffer) { var buffer = RetrieveBuffer(); sysExBuffer.Stream.Position = 0; buffer.Position = 0; sysExBuffer.Stream.CopyTo(buffer, 0); _outPort.LongData(buffer); }
public static MidiSysExBuffer From(MidiBufferStream buffer) { int length = (int)buffer.BytesRecorded; var sysExBuffer = new MidiSysExBuffer(length); buffer.Position = 0; buffer.Read(sysExBuffer._buffer, 0, length); return(sysExBuffer); }
private void DispatchedAddBuffer(MidiSysExBuffer buffer) { _appData.SysExBuffers.Add(buffer); }
private void ScheduleAddBuffer(MidiSysExBuffer buffer) { _appData.Dispatcher.Invoke(new Action(() => DispatchedAddBuffer(buffer))); }