Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins support for MuseScore 3 #4610

Merged
merged 7 commits into from Jan 25, 2019

Conversation

Projects
None yet
4 participants
@dmitrio95
Copy link
Contributor

commented Jan 22, 2019

This PR contains the current state of the new plugins API development. As of PR creation date, some functions available in MuseScore 2 API are still missing as well as exposure of most of enumeration types. Still this implementation contains enough functionality to make it possible to port a some plugins to it.

This branch is based on the changes made in #4565. I am not sure that this branch currently maintains the ability of being correctly build without SCRIPT_INTERFACE but it should be not difficult to fix as plugins code is now largely separated from libmscore.

@Jojo-Schmitz

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2019

I tried it with my batch_export plugin, doesn't work, no error message, but no dialog either
batch_export.zip
Any idea? It behaves the same in 3.0 without your changes too?

@dmitrio95

This comment has been minimized.

Copy link
Contributor Author

commented Jan 22, 2019

This plugin shows "unsupported version" warning for me. If I alter the version check a bit it doesn't show anything indeed. Still window.show() call after the version check makes the plugin window be visible so perhaps it should be added there. The same happens in the version built from master.

That plugin would also not work as writeScore function was missing in API. I added it back, as well as tried to fix tests building.

@Jojo-Schmitz

This comment has been minimized.

Copy link
Contributor

commented Jan 23, 2019

Thanks, the version check requires the latest build (>= 3.0.2) and worked with the AppVeyor artifact of your PR. A window.show() was not needed in 2.x, but I can live with it being needed in 3.0 ;-), also a window.visible = true works too, seems the defaults for this property has changed between Qt versions. So with that and your writeScore I can now work on extending and improving it, great!

One remark to the notenames plugin: In 2.x it places the notenames for voice 2 and 4 below staff, not so in your current version, I guess we need to (be able to) use the Above/Below property of staff texts for this rather than (or in addition to) the offsets?

@dmitrio95

This comment has been minimized.

Copy link
Contributor Author

commented Jan 23, 2019

Actually writeScore should probably work in current master too, I just disabled it temporarily during my changes.

On notenames plugin, yes, setting placement should be necessary for that. I'll probably need to expose this and other libmscore enumerations to make it available.
Also I noticed that staff text doesn't really change its vertical placement when I (or a plugin) set an Y offset for it. But that is another story, probably a bug report should be created.

@Jojo-Schmitz

This comment has been minimized.

Copy link
Contributor

commented Jan 23, 2019

For my batch export plugin see the now ported version at http://github.com/Jojo-Schmitz/batch_export/archive/master.zip.
Indeed works in MuseScore 3.0.1 and I assume it to work in 3.0.0 too.

Needs more checking and testing though ;-)

mirabilos and others added some commits Jan 11, 2019

Fix build without SCRIPT_INTERFACE on Qt 5.7
 * without SCRIPT_INTERFACE, Qt 5.7 is enough
 * cursor.cpp depends on FractionWrapper
 * backwards-compatible QString + QStringRef construction
 * let Q_NAMESPACE and Q_ENUM_NS depend on SCRIPT_INTERFACE
 * Ms::Direction must be Q_DECLARE_METATYPE
 * elide plugin-related headers from the build without SCRIPT_INTERFACE
 * supply matching ifdefs for pluginManager calls in main code

This is based on changes by ABL <antonio.lotti@alice.it>
and I merely made it rely on the SCRIPT_INTERFACE compilation
option more (so it does not break anything when SCRIPT_INTERFACE
is on — that is, by default), to make backporting this easier.

Add header defining DBL_MIN and DBL_MAX, and add multiple
inclusion guards around "config.h" as it’s included in many
places.
Add a new QML plugins API
 - Move Qml plugin engine out of libmscore
 - Add Pid::TICK handling to Element class
 - Make tick QML property correspond to absolute tick in all contexts
     That is a temporary solution though, a proper solution would
     require revising Pid::TICK handling
 - Move plugins API to api directory
 - Rename ElementW -> Element (PluginAPI namespace)
 - Remove Qt meta-object macros from Score in libmscore
 - Remove string-based access to properties from QML
 - Remove unused functions from Note
 - Rename QML properties names to camel case
     Two reasons:
       - They were named so in MuseScore 2.X.
       - Using underscored_names is less consistent with MuseScore
         coding style.
Expose enumerations to QML
All enumerations defined directly in Ms namespace had to be moved
to types.h due as Q_NAMESPACE cannot be used multiple times in one
namespace, see https://bugreports.qt.io/browse/QTBUG-68611
Fix plugins tests
Also fix tst_links building. The test was broken since the
Score::addText function was moved to plugins API where it was used
exclusively aside from this test.

@dmitrio95 dmitrio95 force-pushed the dmitrio95:plugins branch from a798ffb to e506b5e Jan 24, 2019

@anatoly-os anatoly-os merged commit 3ea4931 into musescore:master Jan 25, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@anatoly-os anatoly-os changed the title [WIP] Plugins support for MuseScore 3 Plugins support for MuseScore 3 Jan 25, 2019

anatoly-os added a commit that referenced this pull request Jan 25, 2019

fix Mac build
after merging #4610
@mirabilos

This comment has been minimized.

Copy link
Contributor

commented Feb 6, 2019

Unfortunately, it was broken: https://musescore.org/en/node/283625

@dmitrio95

This comment has been minimized.

Copy link
Contributor Author

commented Feb 6, 2019

Try the latest master, it should contain the necessary fixes (at least #4638 and #4643). Building MuseScore with Qt 5.7 works for me after these patches.

@mirabilos

This comment has been minimized.

Copy link
Contributor

commented Feb 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.