コード例 #1
0
        public WaspPreset DecodeFlWasp(FstPreset preset)
        {
            var packet = _fstDataPacketConverter.Decode(preset.Packets.Single(p => p.Id == "FLdt"));
            var offset = 73 + packet.PluginData[55];
            var buffer = new byte[164];

            packet.PluginData.AsSpan(offset, buffer.Length).CopyTo(buffer);

            return(new WaspPreset
            {
                Data = buffer
            });
        }
コード例 #2
0
        public FstPreset Read(Stream stream)
        {
            var result = new FstPreset {
                Packets = new List <FstPacket>()
            };

            while (true)
            {
                var packet = _fstPacketStreamer.Read(stream);
                if (packet == null)
                {
                    break;
                }

                result.Packets.Add(packet);
            }

            return(result);
        }
コード例 #3
0
 public int Write(Stream stream, FstPreset preset)
 {
     return(preset.Packets.Sum(packet => _fstPacketStreamer.Write(stream, packet)));
 }