예제 #1
0
 /// <inheritdoc />
 public void CopyFrom(IPatchPart part)
 {
     if (part is Partial partial)
     {
         Oscillator.CopyFrom(partial.Oscillator);
         Filter.CopyFrom(partial.Filter);
         Amplifier.CopyFrom(partial.Amplifier);
         Lfo.CopyFrom(partial.Lfo);
         ModLfo.CopyFrom(partial.ModLfo);
         Aftertouch.CopyFrom(partial.Aftertouch);
         Other.CopyFrom(partial.Other);
     }
     else
     {
         throw new NotSupportedException("Copying from that type is not supported");
     }
 }
예제 #2
0
        /// <inheritdoc />
        /// <summary>
        ///     Creates new instance of partial
        /// </summary>
        public Partial()
        {
            Oscillator = new Oscillator();
            Filter     = new Filter();
            Amplifier  = new Amplifier();
            Lfo        = new Lfo();
            ModLfo     = new ModLfo();
            Aftertouch = new Aftertouch();
            Other      = new Other();

            Oscillator.PropertyChanged += (sender, args) => NotifyOfPropertyChange(nameof(Oscillator));
            Filter.PropertyChanged     += (sender, args) => NotifyOfPropertyChange(nameof(Filter));
            Amplifier.PropertyChanged  += (sender, args) => NotifyOfPropertyChange(nameof(Amplifier));
            Lfo.PropertyChanged        += (sender, args) => NotifyOfPropertyChange(nameof(Lfo));
            ModLfo.PropertyChanged     += (sender, args) => NotifyOfPropertyChange(nameof(ModLfo));
            Aftertouch.PropertyChanged += (sender, args) => NotifyOfPropertyChange(nameof(Aftertouch));
            Other.PropertyChanged      += (sender, args) => NotifyOfPropertyChange(nameof(Other));
        }