예제 #1
0
        /// <inheritdoc />
        /// <summary>
        ///     Creates new instance of VocalEffect
        /// </summary>
        public VocalEffect()
        {
            Common    = new Common();
            AutoPitch = new AutoPitch();
            Vocoder   = new Vocoder();

            Common.PropertyChanged    += (sender, args) => NotifyOfPropertyChange(nameof(Common));
            AutoPitch.PropertyChanged += (sender, args) => NotifyOfPropertyChange(nameof(AutoPitch));
            Vocoder.PropertyChanged   += (sender, args) => NotifyOfPropertyChange(nameof(Vocoder));
        }
예제 #2
0
        /// <inheritdoc />
        public byte[] GetBytes()
        {
            var bytes = new List <byte>();

            bytes.AddRange(Common.GetBytes());
            bytes.AddRange(AutoPitch.GetBytes());
            bytes.AddRange(Vocoder.GetBytes());
            bytes.AddRange(ByteUtils.RepeatReserve(3));

            return(bytes.ToArray());
        }
예제 #3
0
        /// <inheritdoc />
        public void CopyFrom(byte[] data)
        {
            if (data.Length != DumpLength)
            {
                throw new InvalidDumpSizeException(DumpLength, data.Length);
            }

            Common.CopyFrom(data.Take(5).ToArray());
            AutoPitch.CopyFrom(data.Skip(5).Take(8).ToArray());
            Vocoder.CopyFrom(data.Skip(13).Take(8).ToArray());
        }
예제 #4
0
 /// <inheritdoc />
 public void CopyFrom(IPatchPart part)
 {
     if (part is VocalEffect ve)
     {
         Common.CopyFrom(ve.Common);
         AutoPitch.CopyFrom(ve.AutoPitch);
         Vocoder.CopyFrom(ve.Vocoder);
     }
     else
     {
         throw new NotSupportedException("Copying from that type is not supported");
     }
 }
예제 #5
0
 /// <inheritdoc />
 public void Reset()
 {
     Common.Reset();
     AutoPitch.Reset();
     Vocoder.Reset();
 }