API improvments
Hi,
I listed improvement needs in the API that emerged from discussions I've been part of in the last weeks and months.
Need/Issue | Discussion | Issue ref |
---|---|---|
Clef element details are not available | Bossa Nova setting/plugin? | |
Sibling elements in other parts/excerpts are not exposed | Get cursor to score from parts | |
Fret diagrams dots and bars are not available | Retrieving Fret diagrams details | |
Getting the "parent" score for curScore when curScore is an excerpt of this "parent" score | How to get a "full score" object when curScore is one of the score excerpts ? | |
Dots not exposed for rests | Plugin: Accessing rest dots | |
Key signature details not available | How to add a KeySignature ? | #100501 |
Changing bar to a StartRepeat bar doesn't work correclty | Changing a barline type via code | |
Impossible to access text frames | How can I access other text on the page (besides lyrics)?, … | #337263 |
Expose All Staff Properties | Any way to retrieve staff characteristics? | #311093 |
More methods for QProcess class | #275294 | |
Creation of folders within the FileIO objects | #334952 | |
Creation of folders with the PluginAPI.writeScore method | #334953 | |
Rest dots cannot be accessed by the API | Plugin: Accessing rest dots |
---- old discussion no longer relevant ---
I just cloned the GitHub repo. I'm going to (try and) build it.
Can some of the MS experts point which of the items I listed might an easy one to start with ?
And in which branch to work ? I see no "4.xx" branch. Anyone is working in the "main" branch ?
To avoid making pull request that won't be accepted, is there a process, for validation or review of the User Stories, ... ?
In short, is the whole process about providing code's update described somewhere ?
Thanks
Comments
There's no main branch either. Use the master branch
And the whole process is documented in the developers' handbook...
On the note of plugin request; one thing I'd personally like to see return is the strong typing of elements and their properties as it was in MS2 compared to the shitload of defined but not-relevant properties on the generic "Element" level.
I get that having the plugin API tied directly into the libmscore code (as it was in MS2) has it's downsides; and I get that throwing it all in an abstraction bunch for MS3 was "faster" than creating decent wrappers for all elements. But it makes discovering properties from the QML/JS side a lot harder. Things like inspection loops using
hasOwnProperty
all broke and finding a relevant property became a guessing game (even if there is an automatic documented API with the long list of "perhaps relevant" properties).In reply to On the note of plugin… by jeetee
Completely agree with you. I didn't imagine that there was another possible way than this long exhausting list of properties (I just made a plugin/library to dig into those properties in a more convenient way).
I start thinking that improving the API would deserve a separated project in itself.
In reply to Completely agree with you. I… by parkingb
Just wanted to chime in to thank you for that library! Just tried it and it works really well. Cheers
In reply to Just wanted to chime in to… by gregsadetsky
Glad to hear it's helping you!
In reply to Glad to hear it's helping… by parkingb
Quick question: when developing that plugin (or any other one for that matter), do you have a faster way of getting MS to see any change in the .qml/.js files than clicking the reload button in the Plugin Creator?
What is your typical development cycle like i.e. how do you change code - get MS to see the new code - test?
Thank you!
In reply to Quick question: when… by gregsadetsky
The Development cycle is not ideal.
I work most of time in Notepad++, for both the
.qml
files and the.js
files.When I've modified a
.qml
file I reload it in the Plugin Creator.When I've modified a
.js
file , there is no other choice than going in MuseScore and reloading the plugins (Plugin manager menu, and then Reload the plugin). Because those external files are loaded only once. The same applies to other types of external files, such as images files.In reply to The Development cycle is not… by parkingb
Got it, thank you for your answer!
I haven't done any tests in MS to confirm whether this would work or not, but I'd be curious if a .js file could dynamically include another .js file (through an eval i.e. a poor man's import) and thus always see the latest version of the (downstream) .js file.
Having an external way of triggering the "Plugin reload" command would also be useful, but as that would require custom development, I imagine that it's more out of reach.
I propose adding: "Expose All Staff Properties."
Discussion at Issue 311093 Make Complete Set of Staff Properties Available to the QML Plugin API