Skip to content

Commit

Permalink
[Cmd: Double/Half Duration] Allow to apply to a list selection - equi…
Browse files Browse the repository at this point in the history
…valent to pressing a duration toggle. Shift also allowed
  • Loading branch information
worldwideweary authored and Jojo-Schmitz committed Sep 2, 2024
1 parent 1a46fae commit a50ea8a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions libmscore/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "chordlist.h"
#include "clef.h"
#include "drumset.h"
#include "durationtype.h"
#include "dynamic.h"
#include "hairpin.h"
#include "harmony.h"
Expand Down Expand Up @@ -2766,6 +2767,26 @@ void Score::cmdIncDecDuration(int nSteps, bool stepDotted)
pasteStaff(e, selection().startSegment(), selection().staffStart(), scale);
return;
}
if (selection().isList() && selection().elements().size() > 1) {
// List - act as if pressing duration toggle (distinct from range based Half/Double
TDuration newDuration(stepDotted
? _is.duration().shiftRetainDots(nSteps, stepDotted)
: _is.duration().shift(nSteps));
_is.duration().shiftRetainDots(nSteps, stepDotted);
_is.setDuration(newDuration);
QSet<ChordRest*> crs = getSelectedChordRests();
for (auto cr : getSelectedChordRests()) {
changeCRlen(cr, newDuration);
}
for (auto cr : crs) {
Element* e = cr;
if (cr->isChord())
e = toChord(cr)->upNote();
select(e, SelectType::ADD);
}
return;
}

Element* el = selection().element();
if (el == 0)
return;
Expand Down

0 comments on commit a50ea8a

Please sign in to comment.