public void AddButton(GuiDrumButton button, NumericUpDown nupNoteNormal, NumericUpDown nupNoteAdv, NumericUpDown nupButtonNoteVelocityAdv, ComboBox ddlSwitchStateAdv, CheckBox chkNoteOnCheck) { m_NupNoteArray[NUM_PADS + (byte)button] = nupNoteNormal; m_NupAdvNoteArray[NUM_PADS + (byte)button] = nupNoteAdv; m_NupAdvButtonVelArray[(byte)button] = nupButtonNoteVelocityAdv; m_DdlAdvSwitchStateArray[(byte)button] = ddlSwitchStateAdv; m_ChkNoteOnCheck[(byte)button] = chkNoteOnCheck; InitControl((byte)button, GuiLinkerType.Button, nupNoteNormal); InitControl((byte)button, GuiLinkerType.ButtonVelocity, nupButtonNoteVelocityAdv); InitControl((byte)button, GuiLinkerType.Button, nupNoteAdv); InitControl((byte)button, GuiLinkerType.Button, ddlSwitchStateAdv); InitControl((byte)button, GuiLinkerType.Button, chkNoteOnCheck); InitNumericUpDown(nupNoteNormal); InitNumericUpDown(nupNoteAdv); InitNumericUpDown(nupButtonNoteVelocityAdv); InitDDLSwitchState(ddlSwitchStateAdv); }
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)); } } }
internal void SetMidiNote(GuiDrumButton b, byte note) { m_NupAdvNoteArray[NUM_PADS + (byte)b].Value = note; m_NupNoteArray[NUM_PADS + (byte)b].Value = note; }
internal void SetButtonVelocity(GuiDrumButton drumButton, byte vel) { m_NupAdvButtonVelArray[(byte)drumButton].Value = vel; }
internal void SetButtonSwitchType(GuiDrumButton b, SwitchType type) { SetSelectIndex(ref m_DdlAdvSwitchStateArray[(byte)b], type); }
internal byte GetMidiNote(GuiDrumButton b) { return (byte)m_NupAdvNoteArray[NUM_PADS + (byte)b].Value; }
internal byte GetButtonVelocity(GuiDrumButton drumButton) { return (byte)m_NupAdvButtonVelArray[(byte)drumButton].Value; }
internal SwitchType GetButtonSwitchType(GuiDrumButton drumButton) { return (SwitchType)m_DdlAdvSwitchStateArray[(byte)drumButton].SelectedItem; }
internal byte GetMidiNote(GuiDrumButton b) { return((byte)m_NupAdvNoteArray[NUM_PADS + (byte)b].Value); }
internal byte GetButtonVelocity(GuiDrumButton drumButton) { return((byte)m_NupAdvButtonVelArray[(byte)drumButton].Value); }
internal SwitchType GetButtonSwitchType(GuiDrumButton drumButton) { return((SwitchType)m_DdlAdvSwitchStateArray[(byte)drumButton].SelectedItem); }
internal void CheckboxButton(GuiDrumButton b, bool check) { m_ChkNoteOnCheck[(byte)b].Checked = check; }
private void DrumButtonReleased(GuiDrumButton b) { if (InvokeRequired) { Invoke(new ButtonDelegate(DrumButtonReleased), new object[] { b }); } else { GuiLinker.CheckboxButton(b, false); if (GuiLinker.GetButtonSwitchType(b) == SwitchType.KeyboardLike) MidiSender.SendNoteOff(GuiLinker.GetMidiNote(b)); else if (GuiLinker.GetButtonSwitchType(b) == SwitchType.OnOff) { MidiSender.SendNoteOn(GuiLinker.GetMidiNote(b), GuiLinker.GetButtonVelocity(b)); MidiSender.SendNoteOff(GuiLinker.GetMidiNote(b)); } } }