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

Percussion panel - notation preview basics #25436

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mathesoncalum
Copy link
Contributor

@mathesoncalum mathesoncalum commented Nov 5, 2024

This PR implements the basics of "notation preview mode" in the percussion panel using a new PaintedEngravingItem component (a subclassed QQuickPaintedItem).

Screenshot 2024-11-05 at 15 45 11

src/engraving/rendering/engravingitempreviewpainter.cpp Outdated Show resolved Hide resolved
src/engraving/rendering/engravingitempreviewpainter.cpp Outdated Show resolved Hide resolved
src/notation/view/percussionpanel/percussionpanelmodel.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)
Copy link
Contributor

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.

Copy link
Contributor Author

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!

@mathesoncalum mathesoncalum marked this pull request as ready for review November 6, 2024 11:13
Copy link
Contributor

@cbjeukendrup cbjeukendrup left a 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/palette/view/widgets/drumsetpalette.cpp Outdated Show resolved Hide resolved
src/notation/view/paintedengravingitem.cpp Outdated Show resolved Hide resolved
@zacjansheski
Copy link
Contributor

Tested on MacOS 14, Windows 11, Ubuntu 22.04.3. Approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants