示例#1
0
        public void LongData(MidiBufferStream buffer, long timestamp)
        {
            Trace.WriteLine("Receiving buffer: " + buffer.BytesRecorded);

            var sysExBuffer = MidiSysExBuffer.From(buffer);

            ScheduleAddBuffer(sysExBuffer);
        }
示例#2
0
        public void Send(MidiSysExBuffer sysExBuffer)
        {
            var buffer = RetrieveBuffer();

            sysExBuffer.Stream.Position = 0;
            buffer.Position             = 0;

            sysExBuffer.Stream.CopyTo(buffer, 0);

            _outPort.LongData(buffer);
        }
示例#3
0
        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);
        }
示例#4
0
 private void DispatchedAddBuffer(MidiSysExBuffer buffer)
 {
     _appData.SysExBuffers.Add(buffer);
 }
示例#5
0
 private void ScheduleAddBuffer(MidiSysExBuffer buffer)
 {
     _appData.Dispatcher.Invoke(new Action(() => DispatchedAddBuffer(buffer)));
 }