[QML] Trouble accessing MS elements and properties

• Jul 13, 2016 - 15:39

I don't seem to be able to access anything different than a chord (and notes).
Can someone post an example that goes through a score to access e.g. a dynamic marking?

{syntaxhighlighter brush:cpp}
if(cursor.element.type == Element.CHORD) //does work
if(cursor.element.type == Element.DYNAMIC)
//do not work


while (segment) {
var element = segment.elementAt(track);
if (element) {
var typeName = element.userName();
/* this last instruction only gives these types of elements:
"Clef, Key Armature, Chord, Rest", and maybe something else;
but no .TEXT, for example. No .DYNAMIC., .SLUR., .SLUR_SEGMENT, etc.,
even though I have these elements in my score.


I feel bad asking too many questions, but I hope after a while I'll get the hang of it.
I successfully got a Dynamic object, now I'm trying to read its range value.
{syntaxhighlighter brush:cpp}
It says:

ReferenceError: Dynamic is not defined

But the (very skinny) manual says the enum is

enum (Dynamic.STAFF, .PART, .SYSTEM)

Also, how do I read its "intensity" value (if it's ever accessible)?

I also don't seem able to access hairpins and lines in general.

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