Skip to content

Commit

Permalink
Add mrest and multirest to Toolkit::GetElementsAtTime. Fixes #3850
Browse files Browse the repository at this point in the history
* Test suite evaluated locally
  • Loading branch information
lpugin committed Nov 21, 2024
1 parent 2014238 commit 9002dee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/toolkit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1888,6 +1888,8 @@ std::string Toolkit::GetElementsAtTime(int millisec)
ListOfObjects chords;

measure->FindAllDescendantsByComparison(&notesOrRests, &matchTime);
ClassIdsComparison mRestComparison({ MULTIREST, MREST });
measure->FindAllDescendantsByComparison(&notesOrRests, &mRestComparison, UNLIMITED_DEPTH, FORWARD, false);

// Fill the JSON object
for (Object *object : notesOrRests) {
Expand All @@ -1898,7 +1900,7 @@ std::string Toolkit::GetElementsAtTime(int millisec)
Chord *chord = note->IsChordTone();
if (chord) chords.push_back(chord);
}
else if (object->Is(REST)) {
else if (object->Is({ MREST, MULTIREST, REST })) {
restArray << object->GetID();
}
}
Expand Down

0 comments on commit 9002dee

Please sign in to comment.