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

            var sysExBuffer = MidiSysExBuffer.From(buffer);

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