Cannot show or hide part (show property is now read-only)
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:
currentScore.parts[p].mute = true; // no audio output
currentScore.parts[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 ?
Comments
The documentation states :
bool show
read
Whether part is shown or hidden.
Note that this property was writeable in MuseScore v2.x
In reply to The documentation states :… by damaspi
https://dmitrio95.github.io/plugins/html/class_ms_1_1_plugin_a_p_i_1_1_…
So yes, a known and documented restriction in MuseScore 3
In reply to https://dmitrio95.github.io… by Jojo-Schmitz
The question is not : is it true, is it documented... :)
But How can we hide or show a part ?
Thanks for the reply anyway :)
In reply to The question is not : is it… by damaspi
Simple: you can't, not programatically, not via a plugin.
In reply to Simple: you can't, not… 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 Thanks, my next questions… by damaspi
No idea, I don't believe to to be too difficult to reimplement. Please add this as a Suggestion to the issue tracker
In reply to No idea, I don't believe 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 !
In reply to Ok. I'll check that. It was… by damaspi
Large parts of the Plugin APIs have changed for MuseScore 3, and I'm not really familiar with those anymore
In reply to Large parts of the Plugin… by Jojo-Schmitz
Yes, indeed. Lots of code. I understand.
Issue #301171 created, thanks for the support.
Pierre A.
In reply to Yes, indeed. Lots of code. I… by damaspi
Thanks for #301171: plugin API: cannot set show property for a Part in 3.x :-)