Small request : MidiKeyboardComponent::getKeyPos public ?

Everything is in the title … I’d like to reuse the midi keyboard component and draw a piano roll next to it. I already did it successfully but I had to create a copy of MidiKeyboardComponent only to move getKeyPos to the public interface of the class.

Because this method is const, there’s no risk of messing up the internals of the class, so would it be possible to have it moved to the public part please ?

getKeyPosition is public, can’t you use that?

In my version, it’s protected, and to achieve getKeyPos behaviour, I need to use a private member of MidiKeyboardComponent (xOffset)

Sorry, I meant getKeyStartPosition(), which is what you need, isn’t it?

Nope, I really mean getKeyPos, which I use to draw a piano roll like the one bellow :

It’s quite handy because I don’t need to keep track of the MidiKeyboardComponent changes, as there’s a listener for that. It’s not urgent, but it’s kind of annoying to have to duplicate a whole class, just to change the access of 1 method.

I fail to see why you can’t do that with getKeyStartPosition()… The only other thing that getKeyPos would return is the key depth, which you don’t need.

My turn to mix up. Obivously you’re right. Thank you.