MidiControl change message.
상속: ChannelMessage
예제 #1
0
 public void InputControlChange(Midi.ControlChangeMessage msg)
 {
     if (channel == 0 || channel == (int)msg.Channel + 1)
     {
         _deviceInterface.OnMidiCC((int)msg.Channel + 1, (int)msg.Control, msg.Value);
     }
 }
예제 #2
0
 public void onControlChange(Midi.ControlChangeMessage e)
 {
     if (OnLaunchpadCCKeyPressed != null)
     {
         OnLaunchpadCCKeyPressed(this, new LaunchpadCCKeyEventArgs(int.Parse(e.Control.ToString()), e.Value));
     }
 }
예제 #3
0
 //Event handler for Control Change (top buttons)
 private void controlChange(Midi.ControlChangeMessage msg)
 {
     if (OnLaunchpadCCKeyPressed != null && int.Parse(msg.Control.ToString()) >= 104 && int.Parse(msg.Control.ToString()) <= 111 && msg.Value != 0)
     {
         OnLaunchpadCCKeyPressed(this, new LaunchpadCCKeyEventArgs(int.Parse(msg.Control.ToString()), 1));
     }
 }
예제 #4
0
 private void midiCC(Midi.ControlChangeMessage msg)
 {
     //Console.WriteLine($"<MIDI> CC {msg.Channel} {msg.Device} {msg.Control} {msg.Value}");
     if (msg.Value > 0)
     {
         OnLaunchpadKeyPressed?.Invoke(this, new LaunchpadKeyEventArgs(midiCCToLed(msg.Control), -1, msg.Value));  // top row buttons
     }
     else
     {
         OnLaunchpadKeyReleased?.Invoke(this, new LaunchpadKeyEventArgs(midiCCToLed(msg.Control), -1, msg.Value));  // top row buttons
     }
 }
예제 #5
0
        private void OnInputDeviewControlChange(ControlChangeMessage msg)
        {
            var control = (ValueControl)msg.Control;
            var direction = msg.Value == 63 ? Direction.Down : Direction.Up;

            // update madded values
            var value = GetControlValue(control);
            value += (int) direction;
            SetControlValue(control, value);

            // send event
            OnControlChange(control, direction);
        }
예제 #6
0
 private void OnControlChange(ControlChangeMessage msg)
 {
     Invoke((Action<ControlChangeMessage>)delegate(ControlChangeMessage message)
     {
         Change(InputDevice.InstalledDevices.IndexOf((InputDevice)message.Device),
             (int)message.Control, message.Value);
     }, msg);
 }
예제 #7
0
        private void mInputDevice_ControlChange(ControlChangeMessage msg)
        {
            ToolbarButton toolbarButton = (ToolbarButton)((int)msg.Control - 104);

            LaunchpadButton button = GetButton(toolbarButton);
            if (button == null)
                return;

            button.State = (ButtonPressState)msg.Value;
            if (ButtonPressed != null && button.State == ButtonPressState.Down) {
                ButtonPressed.Invoke(this, new ButtonPressEventArgs(toolbarButton));
            }
        }