n00b questions regarding learning plugin development (v3.x)

• Nov 29, 2019 - 19:57

I'm just getting into plugin development and working through some of the same QML code as well as the available documentation to try to figure things out. One of the main problems I'm having is that the highest quality docs (https://musescore.org/en/handbook/developers-handbook/plugin-development) in terms of "why" and "how" to use various objects seems way out of date with the view of the underlying include files and auto-generated docs. So... I may be generating a series of basic questions on this forum. :-)

Right now here's what I'm scratching my head over...

In terms of simply traversing through a score, what are the differences between using a cursor and cursor.next() vs. obtaining the first segment from a "rewound" cursor and then traversing by moving through the segments via segment.next?

It seems the default cursor instantiation sets up a filter on ChordRest segments. I tried setting the filter to Segment.All, but that didn't quite seem to do the trick. Setting it to -1 did, however. Is that the right approach to see all segments when traversing via cursor.next()?

Why would one set the staffIdx, track, and/or voice for the cursor? Does doing so effectively filter the segments traversed to to those that have elements at the given track?

What is the difference between an KeySig and KeySigAnnounce segment? How would one access a KeySig segment to get at the underlying key signature? I can do this with a TimeSig segment by getting the elementAt(0).timesig, but I can't find a way to access the key signature in an analogous fashion.


A more detailed question relating to the above...

It seems that I can get the current KeySig from a cursor but if I'm traversing by segments rather than with a cursor is there a way to set a cursor directly to a given segment and then be able to read the current key signature from it? I still can't find a way to access a key signature change from the KeySig or KeySigAnnounce segments unless I get to them from a cursor.

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