-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Percussion panel - notation preview basics #25436
Percussion panel - notation preview basics #25436
Conversation
src/notation/view/percussionpanel/percussionpanelpadlistmodel.h
Outdated
Show resolved
Hide resolved
@@ -36,6 +39,8 @@ class PercussionPanelPadModel : public QObject, public muse::async::Asyncable | |||
Q_PROPERTY(QString keyboardShortcut READ keyboardShortcut NOTIFY keyboardShortcutChanged) | |||
Q_PROPERTY(QString midiNote READ midiNote NOTIFY midiNoteChanged) | |||
|
|||
Q_PROPERTY(PaintedEngravingItem * notationPreview READ notationPreview WRITE setNotationPreview NOTIFY notationPreviewChanged) |
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.
You could consider doing this the other way around: making PaintedEngravingItem
a bit smarter, renaming it to PercussionPanelPadNotationPreview
, and telling it about the PercussionPanelPadModel
. Then let the PercussionPanelPadNotationPreview
retrieve the element, based on info from PercussionPanelPadModel
.
That may mean that PercussionPanelPadModel
needs to become aware of the Drumset*
; I think that's okay.
If you take that a bit further, it would mean that PercussionPanelPadModel
only needs a Drumset* and a pitch in its constructor (besides QObject parent). That would simplify PercussionPanelPadListModel::resetLayout
quite a bit, because PercussionPanelPadModel
takes over some responsibilities from there. I'm not sure if that's the way you want to go, but personally I would not be against it.
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.
One of the reasons I like the current approach is because, fundamentally, I think PaintedEngravingItem
could be very useful beyond the percussion panel. For example, we have some future plans to revamp the “edit drumset” dialog and I’m pretty sure a component like this will come in handy over there!
6bc352d
to
8bb9e07
Compare
8bb9e07
to
e8f7d1c
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.
Some cosmetic things, but apart from those it looks good to me!
src/notation/view/percussionpanel/percussionpanelpadlistmodel.h
Outdated
Show resolved
Hide resolved
e8f7d1c
to
22d5118
Compare
Tested on MacOS 14, Windows 11, Ubuntu 22.04.3. Approved |
This PR implements the basics of "notation preview mode" in the percussion panel using a new
PaintedEngravingItem
component (a subclassedQQuickPaintedItem
).