-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix #291708 Plugin: Expose NoteEvent's via QML Note interface. #5224
Conversation
'nix build died on: But it works fine on Windows builds. Any ideas way? -Dale |
4180c84
to
ce17411
Compare
ther mtests don't build, see https://travis-ci.org/musescore/MuseScore/jobs/558741689#L4012-L4034 |
I see the error but how do I correct? This code is building and running fine in Windows using vs2017 plus Qt 5.12.2. What system is the failed build targeting? -Dale |
393d899
to
174368d
Compare
It looks like tests do not build, you probably need to add the new files to MuseScore/mtest/CMakeLists.txt Line 110 in cc654b1
|
174368d
to
e59ccfd
Compare
Thanks for the tip! |
6b106dc
to
dcc19fd
Compare
It doesn't build on Travis CI, looks like you forgot some #include? Probably note.h? |
Of course it builds fine in VS2017! This is one of those compiler difference things that drive me nuts. The template is declared but not instantiated at the point of failure but only uses pointers yet VS2017 is happy and Linux/gcc is not? Ugggg! playevent.h needs a definition from elements.h but elements.h also needs playevent.h. Normally just forward defining the empty class and just using pointers is enough. I'm at a loss. I guess I need to replicate the linux build somehow to investigate this. -Dale |
fd5b5bc
to
bc253ae
Compare
I can get this to build by making these changes: mattmcclinch@5cc9957. My solution was to add a function that takes an |
Matt, Thanks for that! I'll be looking at it right away! Meanwhile, I'll share my discovery... I put together a VMware system with Ubuntu 18.04 all the setup as specified on the MuseScore developer handbook. I cloned the code, built and I got the same errors... BUT WAIT A MINUTE... those aren't errors. They are warnings. I took the next step to 'make install' and it's running flawlessly on my Ubuntu VM. I loaded the same test score and test plugin I've been using on Windows and it works perfectly. That makes me feel much better. I'm definitely going to check out Matt's mods to see if it removes the whole situation. Fingers crossed. The errors posted on Travis-ci may be due to toolchain version. The failed Travis build used: Ubuntu 14.04--not even described on the developers site as a valid target build system might add. Yet my system is: Ubuntu 18.04 With the newer toolchains the error appears to be acceptable as a warning. Ohhhhh the wonderful world of tools! :) -Dale |
bc253ae
to
20a93e1
Compare
Excellent! All is right with the build. Thanks Matt for the skilled eyes on the code! -Dale |
20a93e1
to
0e75e6e
Compare
I am honored that you accepted my changes verbatim, but honestly, I wasn't completely happy with them. Basically, I wanted something a little more general. This is what I have now, which I like a lot better: mattmcclinch@a9efab9. |
I was happy to stop beating my head against a wall plus it worked! I'll check out the improved version. Right now I'm spinning in circles trying to expose the PlayEventType enum through a Chord property. When things don't work it can be real confusion. |
Does this not work? mattmcclinch@29a2883 |
I got it all working. I did have what you suggested but it still denied my playEventType r/w property existence when I tried. THEN I fixed this improper definition that the compiler and tools didn't complain about:
That "Accidental" should be "AccidentalType". This also explained why the AccidentalType enum wasn't available in QML.
Anyway, I'm running a local build with your latest tweak so I'm close to sending up the changes. Oh, also with the new changes I can reset the user playevent and get back the automatic ornamentations. i.e., I can recover that score I hosed! -Dale |
bb79ae2
to
d15e70e
Compare
Why then still the WIP label in PR and commit title? |
Don't miss this comment, which isn't showing up because the conversation has been marked as resolved. The part about the forward declaration of |
a034254
to
686a68f
Compare
To be clear, when using reinterpret_cast<>() you are telling the compiler that you know better than it about the cast (it's the nuclear option of casts.) So we better be right--which we are here. |
686a68f
to
ee70380
Compare
Fixed. |
693d08e
to
5fcb2af
Compare
a29858c
to
459804a
Compare
@@ -0,0 +1,55 @@ | |||
import QtQuick 2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this and other testing files don't seem to belong into this PR, but at least and for sure not into the top level directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was stated in the commit. It will be removed as well as the other commits.
-Dale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, reading helps ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was the only way I could get an application shared to test good and bad at once. :)
3ec0d45
to
6844e45
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also while we are at it, could you please add fix #291708
to the commit message? Something like
fix #291708: Expose PlayEvent's via QML Plugin Note interface
mscore/plugin/api/elements.cpp
Outdated
void Chord::setPlayEventType(Ms::PlayEventType v) | ||
{ | ||
chord()->score()->setPlaylistDirty(); | ||
chord()->score()->undo(new ChangeChordPlayEventType(chord(), v)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function could potentially check whether the chord already has a correct play event type, then it could avoid pushing extra unnecessary commands to undo stack. That is not strictly necessary but could optimize this operation a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But isn't it possible that, even though the playEventType hasn't changed, the playEventLists may have? Woudn't those changes would be lost to a missing redo operation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, maybe I didn't understand the question properly. This function has nothing to do with changing note events at all, if a plugin needs to change play events it would modify the Note.playEvents
property which would also change the play event type to User
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I understand. Check is added.
-Dale
6334905
to
f731b10
Compare
It looks like merging #5243 caused some merge conflicts to appear so rebase is needed for this PR. The conflicts seem to be trivial though. |
Adds capablity to examine and modify PlayEvent's and a Note's playEvents list. Adds access to Chord.playEventType. Also supports UNDO for these operations.
f731b10
to
b05c823
Compare
I was expecting the rebase on this one. Just pushed up the corrections. |
I tested this patch a bit, looks really impressive! I see now why BSG is so encouraged with these new possibilities :) I don't catch any issues anymore so I'll merge this PR when all tests get passed. |
He does seem dang near giddy with the prospects. His This is automation as it should be! The gui selection stuff was needed to make it easy so that adder was really necessary. -Dale |
Adds capablity to examine and modify PlayEvent's.
PlayEvent's are wrappers for an internal object called a NoteEvent.
The name PlayEvent better reflects what it's role is and what
you are really affecting from the QML plugin. Any changes made
with this feature also creates undo frames so they can be removed from
the user interface.