/// <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)); }
/// <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()); }
/// <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()); }
/// <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"); } }
/// <inheritdoc /> public void Reset() { Common.Reset(); AutoPitch.Reset(); Vocoder.Reset(); }