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

            var sysExBuffer = MidiSysExBuffer.From(buffer);

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