Skip to content

Commit

Permalink
fix #23473: avoid dots for notes where it may result in 256th notes/r…
Browse files Browse the repository at this point in the history
…ests or shorter

based on @AntonioBL's PR musescore#544
  • Loading branch information
Jojo-Schmitz committed Mar 12, 2015
1 parent 2c62663 commit ef4ef04
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2599,13 +2599,13 @@ void Score::padToggle(Pad n)
_is.setRest(!_is.rest());
break;
case Pad::DOT:
if (_is.duration().dots() == 1)
if ((_is.duration().dots() == 1) || (_is.duration() == TDuration::DurationType::V_128TH))
_is.setDots(0);
else
_is.setDots(1);
break;
case Pad::DOTDOT:
if (_is.duration().dots() == 2)
if ((_is.duration().dots() == 2) || (_is.duration() == TDuration::DurationType::V_64TH) || (_is.duration() == TDuration::DurationType::V_128TH))
_is.setDots(0);
else
_is.setDots(2);
Expand Down
13 changes: 13 additions & 0 deletions mscore/keyb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,19 @@ void MuseScore::updateInputState(Score* score)
getAction("pad-rest")->setChecked(is.rest());
getAction("pad-dot")->setChecked(is.duration().dots() == 1);
getAction("pad-dotdot")->setChecked(is.duration().dots() == 2);
switch (is.duration().type()) {
case TDuration::DurationType::V_128TH:
getAction("pad-dot")->setChecked(false);
getAction("pad-dot")->setEnabled(false);
case TDuration::DurationType::V_64TH:
getAction("pad-dotdot")->setChecked(false);
getAction("pad-dotdot")->setEnabled(false);
break;
default:
getAction("pad-dot")->setEnabled(true);
getAction("pad-dotdot")->setEnabled(true);
break;
}

getAction("note-longa")->setChecked(is.duration() == TDuration::DurationType::V_LONG);
getAction("note-breve")->setChecked(is.duration() == TDuration::DurationType::V_BREVE);
Expand Down
2 changes: 2 additions & 0 deletions mscore/musescore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2487,6 +2487,8 @@ void MuseScore::changeState(ScoreState val)
qDebug("disable synth control");
a->setEnabled(driver);
}
else if (s->key() == "pad-dot" || s->key() == "pad-dot-dot")
a->setEnabled(!(val & (STATE_ALLTEXTUAL_EDIT | STATE_EDIT)));
else {
a->setEnabled(s->state() & val);
}
Expand Down

0 comments on commit ef4ef04

Please sign in to comment.