Acessing to Coda, Segno elements

• Aug 21, 2019 - 19:52

Hi all,
I'm trying to develop a plugin that colours authomatically Coda, Segno, D.C. To Coda, etc. elements but I don't know how to access them through a plugin. I tried to access through segment.annotations but the lenght is 0 for all the elements in the score. I attach a screenshot of two elements I'm trying to access.

Is it possible in the current version of plugin developer to access to this elements? If yes, how?

Thank you very much in advance for your help.

Marta.

Attachment Size
Screenshot_4.jpg 17.97 KB

Comments

Repeat markings like these are not actually stored as segment annotations but as part of the element list for the measure. Not sure if that list is exposed to plugins or not. but anyhow, that's where you'd need to be looking.

In reply to by Marta Morticia

The list of measure elements was indeed missing from the plugins framework. I have just pushed a patch which exposes it to plugins. This change will be available in the upcoming 3.3 release (3.3 Beta version is expected to be released soon) or in the upcoming nightly builds.

Here is a simple example of the code which colors all repeat markings in a score with this change:

for (var m = curScore.firstMeasure; m; m = m.nextMeasure) {
    var elements = m.elements;
    for (var i = 0; i < elements.length; i++) {
        var e = elements[i];
        if (e.type == Element.MARKER)
            e.color = "cyan";
        else if (e.type == Element.JUMP)
            e.color = "violet";
    }
}

Hope this helps!

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