From 4529d371f026fe59329b146c6c9d687e287aaf7c Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Mon, 10 Aug 2020 17:10:40 +0200 Subject: [PATCH] Add a helper function to off all sister voices at once --- src/sfizz/SisterVoiceRing.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/sfizz/SisterVoiceRing.h b/src/sfizz/SisterVoiceRing.h index 78935335..93dbc515 100644 --- a/src/sfizz/SisterVoiceRing.h +++ b/src/sfizz/SisterVoiceRing.h @@ -56,6 +56,22 @@ struct SisterVoiceRing { return count; } + /** + * @brief Off all sisters in a ring + * + * @param voice + * @param delay + */ + template>::value, int> = 0> + static void offAllSisters(T* voice, int delay) { + if (voice != nullptr) { + SisterVoiceRing::applyToRing(voice, [&] (Voice* v) { + v->off(delay); + }); + } + } + /** * @brief Check if a sister voice ring is well formed *