private void ApplyToken(InstrumentToken token) { if (Content is Instrument.InstrumentBase) { (Content as Instrument.InstrumentBase).IsActive = false; } if (token == null) { Content = null; ClearValue(VelocityLabelProperty); ClearValue(SustainLabelProperty); } else { Instrument.InstrumentBase instrument = token.Factory(); Content = instrument; VelocityLabel = instrument.VelocityLabel; SustainLabel = instrument.SustainLabel; _midiLink.RepublishState(); instrument.IsActive = true; Settings.Default.ActiveInstrument = token.Name; Settings.Default.Save(); } }
private static InstrumentBase MakeDefaultInstrument() { InstrumentBase defaultInstrument = Activator.CreateInstance(_defaultType) as InstrumentBase; return(defaultInstrument); }