public void SaveDeejControl()
        {
            // Check for valid widget entries.
            if (string.IsNullOrEmpty(SelectedDeej) ||
                CapturedDeejInControls.Count <= 0 ||
                string.IsNullOrEmpty(CapturedDeejInControls[CapturedDeejInControlsSelected]))
            {
                MessageBox.Show(Properties.Resources.IncompleteDeviceConfigurationMessage, "EarTrumpet", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            // Generate Deej control configuration object.
            DeejConfiguration deejConfiguration = new DeejConfiguration(SelectedDeej, GetCurrentSelectionProperty("Channel"), MinValue, MaxValue, ScalingValue);

            // Notify the hardware settings about the new control configuration.
            _hardwareSettings.ControlSelectedCallback(deejConfiguration);
        }
예제 #2
0
        public void SaveMidiControl()
        {
            // Check for valid widget entries.
            if (string.IsNullOrEmpty(SelectedMidi) ||
                string.IsNullOrEmpty(CapturedMidiInControls[CapturedMidiInControlsSelected]) ||
                string.IsNullOrEmpty(ControlTypes[ControlTypeSelected]))
            {
                MessageBox.Show(Resources.IncompleteDeviceConfigurationMessage, "EarTrumpet", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            // Generate MIDI control configuration object.
            MidiConfiguration midiConfiguration = new MidiConfiguration(SelectedMidi, GetCurrentSelectionProperty("Channel"), GetCurrentSelectionProperty("Controller"), MidiConfiguration.GetControllerType(ControlTypes[_controlTypeSelected]), MinValue, MaxValue, ScalingValue);

            // Notify the hardware settings about the new control configuration.
            _hardwareSettings.ControlSelectedCallback(midiConfiguration);
        }