mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-09 05:25:01 +00:00
Use fold expression for final-answer is_stereo.
This commit is contained in:
@@ -17,6 +17,15 @@
|
|||||||
|
|
||||||
namespace Outputs::Speaker {
|
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.
|
A CompoundSource adds together the sound generated by multiple individual SampleSources.
|
||||||
An owner may optionally assign relative volumes.
|
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.
|
@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
|
@returns the average output peak given the sources owned by this CompoundSource and the
|
||||||
|
Reference in New Issue
Block a user