Beispiel #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
            });
        }
Beispiel #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);
        }
Beispiel #3
0
 public int Write(Stream stream, FstPreset preset)
 {
     return(preset.Packets.Sum(packet => _fstPacketStreamer.Write(stream, packet)));
 }