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

Disable most toolbar editing options for trill cue notes #19304

Merged
merged 3 commits into from
Nov 9, 2023

Conversation

miiizen
Copy link
Contributor

@miiizen miiizen commented Sep 6, 2023

Resolves: #18330

Disable editing trill cue note:

  • duration
  • articulation
  • voice

and make behaviour when trying to make the cue note a triplet consistent with grace notes (ie. does nothing)

  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

@@ -1994,7 +1995,7 @@ void NotationInteraction::doAddSlur(const mu::engraving::Slur* slurTemplate)
secondChordRest = mu::engraving::nextChordRest(firstChordRest);
}

if (firstChordRest) {
if (firstChordRest && !(firstChordRest->isTrillCueNote() || secondChordRest->isTrillCueNote())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure but it might be wise to add a null check for secondChordRest here...

Suggested change
if (firstChordRest && !(firstChordRest->isTrillCueNote() || secondChordRest->isTrillCueNote())) {
if (firstChordRest && !(firstChordRest->isTrillCueNote() || (secondChordRest && secondChordRest->isTrillCueNote()))) {

(Inside doAddSlur, it seems not bad if secondChordRest is null, but for performing this check itself, it does matter of course.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried it out: indeed a null check is necessary. (add a trill to the very last note of a score, and try to add a slur between the main note and the trill cue note)

@@ -1965,12 +1965,13 @@ void NotationInteraction::doAddSlur(const mu::engraving::Slur* slurTemplate)
}
}

if (firstChordRest && (firstChordRest != secondChordRest)) {
if (firstChordRest && (firstChordRest != secondChordRest)
&& !(firstChordRest->isTrillCueNote() || secondChordRest->isTrillCueNote())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe here too actually

Suggested change
&& !(firstChordRest->isTrillCueNote() || secondChordRest->isTrillCueNote())) {
&& !(firstChordRest->isTrillCueNote() || (secondChordRest && secondChordRest)->isTrillCueNote())) {

if (isChord()) {
m_isTrillCueNote = v;
} else {
m_isTrillCueNote = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks too weird. It should be in the Chord class. Also, for setters, you would expect them to always change the current value, not under some conditions...

@cbjeukendrup cbjeukendrup merged commit deab1db into musescore:master Nov 9, 2023
11 checks passed
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.

Should not allow changing duration of trill cue notes
4 participants