public MidiPerformance(IMidiLink midiLink, MidiValueStrategy valueStrategy = MidiValueStrategy.Raw) { // null is ok _midiLink = midiLink; _instances.Add(new WeakReference <MidiPerformance>(this)); ValueStrategy = valueStrategy; _pitchBend = ValueStrategy == MidiValueStrategy.Normalized ? 0f : RAW_PITCHBEND_SCALE; // TODO I think I need to supress this attachment in design mode _midiLink.AttachListener(this); }
public Keyboard(IMidiLink midiLink) { if (midiLink == null) { throw new ArgumentNullException("midiLink"); } _midiLink = midiLink; InitializeComponent(); SizeChanged += HandleSizeChanged; if (!this.IsInDesignMode()) { _midiLink.AttachListener(this); } }