mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-26 15:32:04 +00:00
Use fold expression for final-answer is_stereo.
This commit is contained in:
parent
d481f335b8
commit
147d817977
@ -17,6 +17,15 @@
|
||||
|
||||
namespace Outputs::Speaker {
|
||||
|
||||
/// @returns @c true if any of the templated sources is stereo; @c false otherwise.
|
||||
template <typename... S> 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 <typename... T> class CompoundSource:
|
||||
/*!
|
||||
@c true if any of the sources owned by this CompoundSource is stereo.
|
||||
*/
|
||||
static constexpr bool is_stereo = CompoundSourceHolder<T...>::is_stereo;
|
||||
static constexpr bool is_stereo = ::Outputs::Speaker::is_stereo<T...>();
|
||||
|
||||
/*!
|
||||
@returns the average output peak given the sources owned by this CompoundSource and the
|
||||
|
Loading…
x
Reference in New Issue
Block a user