Programming question: Hammer-on and Pull-off text
I am currently working on adding hammer-on and pull-off support to Musescore. I have created a new slur object that is very similar to a tie (i.e. it connects 2 notes, not 2 chords). I have a question about how to add the text (i.e. the little "H" or "P".) The text can be placed in one of 4 locations: above, below, onslur and onstem.
The question is: Should I "draw" the text myself or should I add a Text (or SystemText) object. The second approach seems simpler because text objects already are hooked into the auto layout engine however the text will be independent from the slur which may be a problem. For example, if you delete the slur the text will remain. So you need some way to link a text object to my new slur object so the slur is aware of changes to the text.
The "draw the text like a glissando" approach is better but how do you make sure the text is included in the auto layout/stacking logic above/below the staff.
Any help here would be greatly appreciated.