Example #1
0
        private void DPadOn(GuiDrumDPad dp)
        {
            Debug.Assert((byte)dp % 2 == 0, "only left, up, right, down is allowed here");

            if (GuiLinker.GetButtonChecked(dp) == false)
            {
                GuiLinker.CheckboxButton(dp, true);
                MidiSender.SendNoteOn(GuiLinker.GetMidiNote(dp), GuiLinker.GetButtonVelocity(dp));
                if (GuiLinker.GetButtonSwitchType(dp) != SwitchType.KeyboardLike)
                {
                    MidiSender.SendNoteOff(GuiLinker.GetMidiNote(dp));
                }
            }
        }
Example #2
0
 private void DrumButtonPressed(GuiDrumButton b)
 {
     if (InvokeRequired)
     {
         Invoke(new ButtonDelegate(DrumButtonPressed), new object[] { b });
     }
     else
     {
         GuiLinker.CheckboxButton(b, true);
         MidiSender.SendNoteOn(GuiLinker.GetMidiNote(b), GuiLinker.GetButtonVelocity(b));
         if (GuiLinker.GetButtonSwitchType(b) != SwitchType.KeyboardLike)
         {
             MidiSender.SendNoteOff(GuiLinker.GetMidiNote(b));
         }
     }
 }