void MidiKeyboardComponent::getKeyPos (int midiNoteNumber, int& x, int& w) const { getKeyPosition (midiNoteNumber, keyWidth, x, w); int rx, rw; getKeyPosition (rangeStart, keyWidth, rx, rw); x -= xOffset + rx; }
bool KeyboardController::isButtonPressed(int buttonIdentifier) const { QPair<int, int> position = getKeyPosition(buttonIdentifier); if (position.first != -1 && position.second != -1) return m_keyStates.keys[position.first] & (1 << position.second); return false; }
void KeyboardController::setButtonValue(int key, bool value) { QPair<int, int> position = getKeyPosition(key); if (position.first != -1 && position.second != -1) { if (value) m_keyStates.keys[position.first] |= (1 << position.second); else m_keyStates.keys[position.first] &= ~(1 << position.second); } }
Range<float> MidiKeyboardComponent::getKeyPos (int midiNoteNumber) const { return getKeyPosition (midiNoteNumber, keyWidth) - xOffset - getKeyPosition (rangeStart, keyWidth).getStart(); }