diff --git a/Outputs/Speaker/Implementation/CompoundSource.hpp b/Outputs/Speaker/Implementation/CompoundSource.hpp index 585ab0c1f..d46fc14ed 100644 --- a/Outputs/Speaker/Implementation/CompoundSource.hpp +++ b/Outputs/Speaker/Implementation/CompoundSource.hpp @@ -17,6 +17,15 @@ namespace Outputs::Speaker { +/// @returns @c true if any of the templated sources is stereo; @c false otherwise. +template constexpr bool is_stereo() { + bool is_stereo = false; + ([&] { + is_stereo |= S::is_stereo; + }(), ...); + return is_stereo; +} + /*! A CompoundSource adds together the sound generated by multiple individual SampleSources. An owner may optionally assign relative volumes. @@ -148,7 +157,7 @@ template class CompoundSource: /*! @c true if any of the sources owned by this CompoundSource is stereo. */ - static constexpr bool is_stereo = CompoundSourceHolder::is_stereo; + static constexpr bool is_stereo = ::Outputs::Speaker::is_stereo(); /*! @returns the average output peak given the sources owned by this CompoundSource and the