Cannot show or hide part (show property is now read-only)

• Feb 15, 2020 - 10:48

Hello all,
I have a plugin that I made for my choir creating automatically from a SATB sheet all independent sheets for each voice, an audio output for each voice and a tutti, plus one tutti for each voice with the voice louder, in order to help the learning.
In Musescore 1, I had the following lines:[p].mute = true; // no audio output[p].show = false; // no presence of part on sheet
Now, I have the following error :
21:-1: TypeError: Cannot assign to read-only property "show"

How can I show or hide a part programmatically ?


The documentation states :
bool show
Whether part is shown or hidden.
Note that this property was writeable in MuseScore v2.x

In reply to by Jojo-Schmitz

Thanks, my next questions would be : what is the requirement that has driven that change in the API ? Is there now a technical incompatibility ? Would it be possible to contribute to reinstate this or the architecture changed too much to allow that ?

In reply to by Jojo-Schmitz

Ok. I'll check that.
It was committed in "mscore/plugin/api/part.h" by Dale Larson as a read only property when adding all the properties from version 2.0 with the comment "The v3.0 release lost many properties for the Part
object when it released. This commit restores them." But it was set as read only, so I don't know if it was on purpose (I suppose so)...
I have seen your name many times in that file, so I suppose you know more than what you just said :D
Thanks, I'll go to the Issue Tracker !

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