Example #1
0
        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();
            }
        }
Example #2
0
        private static InstrumentBase MakeDefaultInstrument()
        {
            InstrumentBase defaultInstrument = Activator.CreateInstance(_defaultType) as InstrumentBase;

            return(defaultInstrument);
        }