Exemplo n.º 1
0
 /// <summary>
 /// This class should be created and passed into Application.Run( ... )
 /// </summary>
 public CustomApplicationContext(ConfigValues values, MidiProcessor processor)
 {
     configValues  = values;
     midiProcessor = processor;
     InitializeContext();
 }
Exemplo n.º 2
0
        public Config(ConfigValues values, MidiProcessor processor)
        {
            InitializeComponent();
            configValues  = values;
            midiProcessor = processor;

            for (int device = 0; device < MidiOut.NumberOfDevices; device++)
            {
                comboBoxOutput.Items.Add(MidiOut.DeviceInfo(device).ProductName);
            }

            foreach (var layout in ConfigValues.Layouts.Choices)
            {
                comboBoxLayout.Items.Add(layout);
            }

            foreach (var pressure in ConfigValues.Pressures.Choices)
            {
                comboBoxPressure.Items.Add(pressure);
            }

            foreach (var touchStripMode in ConfigValues.TouchStripModes.Choices)
            {
                comboBoxTouchStrip.Items.Add(touchStripMode);
            }

            foreach (var pedalMode in ConfigValues.PedalModes.Choices)
            {
                comboBoxPedal.Items.Add(pedalMode);
            }

            foreach (var scale in MidiProcessor.Scales.Keys)
            {
                comboBoxScale.Items.Add(scale);
                comboBoxSwitchedScale.Items.Add(scale);
            }

            foreach (var key in configValues.Keys.Keys)
            {
                comboBoxKey.Items.Add(key);
            }

            comboBoxLayoutStore.Items.Add("Current");
            foreach (var store in Push.StoreageButtonLabels.Values)
            {
                comboBoxLayoutStore.Items.Add("Store " + store);
            }

            comboBoxOutput.SelectedIndex        = 0;
            comboBoxLayout.SelectedIndex        = 0;
            comboBoxLayoutStore.SelectedIndex   = 0;
            comboBoxScale.SelectedIndex         = 0;
            comboBoxSwitchedScale.SelectedIndex = 0;
            comboBoxKey.SelectedIndex           = 0;
            comboBoxPressure.SelectedIndex      = 0;
            comboBoxTouchStrip.SelectedIndex    = 0;
            comboBoxPedal.SelectedIndex         = 0;

            if (!String.IsNullOrEmpty(values.Output))
            {
                comboBoxOutput.SelectedItem = values.Output;
            }
            if (!String.IsNullOrEmpty(values.Layout))
            {
                comboBoxLayout.SelectedItem = values.Layout;
            }
            comboBoxPressure.SelectedItem         = values.Pressure;
            comboBoxTouchStrip.SelectedItem       = values.TouchStripMode;
            comboBoxPedal.SelectedItem            = values.PedalMode;
            checkBoxUserModeOnly.Checked          = configValues.UserModeOnly;
            comboBoxPadStartNote.SelectedIndex    = configValues.FixLayout ? 1 : 0;
            comboBoxKeyChangeAmount.SelectedIndex = configValues.KeyChangeFifths ? 1 : 0;

            LoadScaleValues();
        }