Skip to content

Commit

Permalink
Merge pull request #544 from AntonioBL/dots_256th
Browse files Browse the repository at this point in the history
avoid dots for notes which may result in 256th notes/rests or shorter
  • Loading branch information
lasconic committed Mar 9, 2015
2 parents 4b1e86f + 2f8840d commit 1af29ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libmscore/score.cpp
Expand Up @@ -2601,13 +2601,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
Expand Up @@ -317,8 +317,21 @@ void MuseScore::updateInputState(Score* score)
}

getAction("pad-rest")->setChecked(is.rest());
getAction("pad-dot")->setEnabled(true);
getAction("pad-dotdot")->setEnabled(true);
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:
break;
}

getAction("note-longa")->setChecked(is.duration() == TDuration::DurationType::V_LONG);
getAction("note-breve")->setChecked(is.duration() == TDuration::DurationType::V_BREVE);
Expand Down

0 comments on commit 1af29ba

Please sign in to comment.