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 = this.RetrieveBuffer();

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

            StreamHelpers.CopyTo(sysExBuffer.Stream, buffer, 0);

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