Plugin framework: Cursor
Hi,
As far as I understand it, the Cursor
object has two (potential?) issues:
1) next()
method:
The method does not advances the cursor to the next chord / rest (incidentally, is MuseScore.CHORDREST
type usable?) in the staffIdx / voice set into the cursor, but to the next segment score-wide; if the score has more than 1 staff and/or more than 1 voice, the cursor may end up mid-chord or mid-rest if another staff/voice has a chord/rest there. At this point, accessing the Cursor element
member raises an exception.
Is this intentional?
If the goal is to make accessible through cursors other score objects (like time signatures, clefs or whatever), it is perhaps the case to further specialize the next()
method: Cursor.next(objectType);
For information: In ver 1.2, there was code to advance the cursor to the next chord/rest of the cursor staff/voice but it has been commented out; so the issue applies to ver 1.2 too.
2) Lack of eos()
method:
Currently there is no reliable way I am aware of to check if the cursor has reached the end of the score, as simply testing !cursor.element
seems to apply to mid-score contexts as well. Adding such a method (or property) would make things easier and more reliable.
Comments?
Thanks,
M.