From 9002deece9b457c0742087014918b589f81abecf Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Thu, 21 Nov 2024 18:35:09 +0100 Subject: [PATCH] Add mrest and multirest to Toolkit::GetElementsAtTime. Fixes #3850 * Test suite evaluated locally --- src/toolkit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/toolkit.cpp b/src/toolkit.cpp index 3ed1bd7bbc..7d608678b2 100644 --- a/src/toolkit.cpp +++ b/src/toolkit.cpp @@ -1888,6 +1888,8 @@ std::string Toolkit::GetElementsAtTime(int millisec) ListOfObjects chords; measure->FindAllDescendantsByComparison(¬esOrRests, &matchTime); + ClassIdsComparison mRestComparison({ MULTIREST, MREST }); + measure->FindAllDescendantsByComparison(¬esOrRests, &mRestComparison, UNLIMITED_DEPTH, FORWARD, false); // Fill the JSON object for (Object *object : notesOrRests) { @@ -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(); } }