1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added a method MidiKeyboardComponent::getTotalKeyboardWidth()

This commit is contained in:
jules 2016-03-01 16:33:53 +00:00
parent beac2e4b3a
commit 5cdd56065d
2 changed files with 10 additions and 0 deletions

View file

@ -270,6 +270,13 @@ int MidiKeyboardComponent::getKeyStartPosition (const int midiNoteNumber) const
return x;
}
int MidiKeyboardComponent::getTotalKeyboardWidth() const noexcept
{
int x, w;
getKeyPos (rangeEnd, x, w);
return x + w;
}
int MidiKeyboardComponent::getNoteAtPosition (Point<int> p)
{
float v;

View file

@ -209,6 +209,9 @@ public:
*/
int getKeyStartPosition (int midiNoteNumber) const;
/** Returns the total width needed to fit all the keys in the available range. */
int getTotalKeyboardWidth() const noexcept;
/** Returns the key at a given coordinate. */
int getNoteAtPosition (Point<int> position);