Plugins/QML: System-and-frame cursor needed.

• Aug 7, 2019 - 11:59

The current mechanism provided for scanning scores is "the cursor" (one of very many so-named things in MS), which scans individual staves enumerating/producing segment-like Elements such as real segments (chord stacks), key and time signatures, barlines, etc.

There is currently no way to scan the score to enumerate (musical) system-like things (as reported by the debugger), such as staff systems, and text and vertical frames (boxes). The horizontal frames, which act ike measures within systems, also need visibility.

The need for this should be clear. I'd like access to text (beyond staff text). There is no way in MuseScore to find text strings (and people finding typos in my documents have to specify geographical position to me as a result). Text justification of boxes could be provided, or at least explored, by plugins. Frames and their text should be accessible to, and eventually even creatable, by plugins.

The current cursor implementation is pretty simple (I studied it last night). A similar artifact, perhaps systemCursor, that walked systems and TBOX/VBOXes would be easy to create using it as a model (complicating/modalizing the current cursor seems a bad idea). How to get HBOXes and measures (to make HBOX text and system texts accessible) is less clear right now, but not unimaginable (maybe system texts belong in the extant cursor).


The way most things are structured in the code, what makes more sense is to walk MeasureBases, not systems - measures are permanent objects, systems are ephemeral artifacts of the current layout. Frames and measures are both MeasureBases. Vertical and text frames are assumed to live alone on a system, horizontal frames and measures are collected until either an explicit break (or a vertical or text frame) is encountered or it is determined that the MeasureBase wouldn't fit.

Text in frames would be accessed this way by walking the measurebase list, noticing when you have a frame (box) rather than a measure, and if so, grabbing its element list (internally, "text" in the case of text frame, I think, but maybe this is better exposed as if it were the element list).

Do you still have an unanswered question? Please log in first to post your question.