[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
//EVERYTHING ELSE, like:
if(cursor.element.type == Element.DYNAMIC)
//do not work

[...]

while (segment) {
var element = segment.elementAt(track);
if (element) {
var typeName = element.userName();
console.log(typeName);
/* 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.
*/
{/syntaxhighlighter}


Comments

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}
if(range==Dynamic.STAFF)
...
{/syntaxhighlighter}
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)?

Edit:
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.