Add a helper function to off all sister voices at once
This commit is contained in:
parent
f318c528a2
commit
4529d371f0
1 changed files with 16 additions and 0 deletions
|
|
@ -56,6 +56,22 @@ struct SisterVoiceRing {
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Off all sisters in a ring
|
||||||
|
*
|
||||||
|
* @param voice
|
||||||
|
* @param delay
|
||||||
|
*/
|
||||||
|
template<class T,
|
||||||
|
absl::enable_if_t<std::is_same<Voice, absl::remove_const_t<T>>::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
|
* @brief Check if a sister voice ring is well formed
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue