Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        public IEnumerable <MidiSysExBuffer> Deserialize(Stream stream)
        {
            var buffers = new List <MidiSysExBuffer>();
            var temp    = new MemoryStream();

            while (ScanSysExMarkers(stream, temp))
            {
                var length = (int)temp.Position;
                var buffer = new MidiSysExBuffer(length);
                temp.Position = 0;  // re-read

                StreamHelpers.CopyTo(temp, buffer.Stream, length);
                //temp.CopyTo(buffer.Stream);


                buffers.Add(buffer);

                temp = new MemoryStream();
            }

            return(buffers);
        }
Exemplo n.º 3
0
 private void Serialize(Stream stream, MidiSysExBuffer buffer)
 {
     StreamHelpers.CopyTo(buffer.Stream, stream, 0);
 }