Exemple #1
0
        /// <inheritdoc />
        public void CopyFrom(IPatchPart part)
        {
            if (part is Partial p)
            {
                Basic.CopyFrom(p.Basic);
                Assign.CopyFrom(p.Assign);
                Amplifier.CopyFrom(p.Amplifier);
                Output.CopyFrom(p.Output);
                Expression.CopyFrom(p.Expression);
                VelocityControl.CopyFrom(p.VelocityControl);

                for (var i = 0; i < p.Wmts.Length; i++)
                {
                    Wmts[i].CopyFrom(p.Wmts[i]);
                }

                Pitch.CopyFrom(p.Pitch);
                Tvf.CopyFrom(p.Tvf);
                Tva.CopyFrom(p.Tva);
                Other.CopyFrom(p.Other);
            }
            else
            {
                throw new NotSupportedException("Copying from that type is not supported");
            }
        }
Exemple #2
0
        /// <inheritdoc />
        public void CopyFrom(byte[] data)
        {
            if (data.Length != DumpLength)
            {
                throw new InvalidDumpSizeException(DumpLength, data.Length);
            }

            Basic.CopyFrom(data.Take(12).ToArray());
            Assign.CopyFrom(data.Skip(12).Take(2).ToArray());
            Amplifier.CopyFrom(data.Skip(14).Take(8).ToArray());
            Output.CopyFrom(data.Skip(22).Take(6).ToArray());
            Expression.CopyFrom(data.Skip(28).Take(4).ToArray());
            VelocityControl.CopyFrom(data.Skip(32).Take(1).ToArray());

            for (var i = 0; i < Wmts.Length; i++)
            {
                Wmts[i].CopyFrom(data.Skip(33 + i * 29).Take(29).ToArray());
            }

            Pitch.CopyFrom(data.Skip(149).Take(13).ToArray());
            Tvf.CopyFrom(data.Skip(162).Take(20).ToArray());
            Tva.CopyFrom(data.Skip(182).Take(11).ToArray());
            Other.CopyFrom(data.Skip(193).Take(2).ToArray());
        }