2013-08-08 09:54:33 +00:00
|
|
|
/*=============================================================================
|
2019-01-07 08:47:17 +00:00
|
|
|
Copyright (c) 2011-2019 Bolero MURAKAMI
|
2013-08-08 09:54:33 +00:00
|
|
|
https://github.com/bolero-MURAKAMI/Sprout
|
|
|
|
|
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
=============================================================================*/
|
2012-11-25 01:09:41 +00:00
|
|
|
#ifndef SPROUT_COMPOST_FORMATS_EFFECTED_RIGHT_HPP
|
|
|
|
#define SPROUT_COMPOST_FORMATS_EFFECTED_RIGHT_HPP
|
2012-11-24 16:05:11 +00:00
|
|
|
|
|
|
|
#include <sprout/config.hpp>
|
|
|
|
#include <sprout/utility/lvalue_forward.hpp>
|
|
|
|
#include <sprout/compost/formats/left_channel.hpp>
|
|
|
|
#include <sprout/compost/formats/right_channel.hpp>
|
|
|
|
#include <sprout/compost/formats/stereo.hpp>
|
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
namespace compost {
|
|
|
|
namespace formats {
|
|
|
|
//
|
2012-11-25 01:09:41 +00:00
|
|
|
// effect_right_holder
|
2012-11-24 16:05:11 +00:00
|
|
|
//
|
|
|
|
template<typename Adaptor>
|
2012-11-25 01:09:41 +00:00
|
|
|
class effect_right_holder {
|
2012-11-24 16:05:11 +00:00
|
|
|
public:
|
|
|
|
typedef Adaptor adaptor_type;
|
|
|
|
private:
|
|
|
|
adaptor_type adaptor_;
|
|
|
|
public:
|
2012-11-25 01:09:41 +00:00
|
|
|
explicit SPROUT_CONSTEXPR effect_right_holder(adaptor_type const& adaptor)
|
2012-11-24 16:05:11 +00:00
|
|
|
: adaptor_(adaptor)
|
|
|
|
{}
|
|
|
|
SPROUT_CONSTEXPR adaptor_type const& adaptor() const {
|
|
|
|
return adaptor_;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
// effected_right_cannel_forwarder
|
|
|
|
//
|
|
|
|
class effected_right_cannel_forwarder {
|
|
|
|
public:
|
|
|
|
template<typename Adaptor>
|
2012-11-25 01:09:41 +00:00
|
|
|
SPROUT_CONSTEXPR sprout::compost::formats::effect_right_holder<Adaptor>
|
2013-02-19 17:23:20 +00:00
|
|
|
operator()(Adaptor const& adaptor) const {
|
2012-11-25 01:09:41 +00:00
|
|
|
return sprout::compost::formats::effect_right_holder<Adaptor>(adaptor);
|
2012-11-24 16:05:11 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
// effected_right_cannel
|
|
|
|
//
|
|
|
|
namespace {
|
2012-12-17 14:10:23 +00:00
|
|
|
SPROUT_STATIC_CONSTEXPR sprout::compost::formats::effected_right_cannel_forwarder effected_right_cannel = {};
|
2012-11-24 16:05:11 +00:00
|
|
|
} // anonymous-namespace
|
|
|
|
|
|
|
|
//
|
|
|
|
// operator|
|
|
|
|
//
|
|
|
|
template<typename Range, typename Adaptor>
|
|
|
|
inline SPROUT_CONSTEXPR auto
|
2012-11-25 01:09:41 +00:00
|
|
|
operator|(Range&& lhs, sprout::compost::formats::effect_right_holder<Adaptor> const& rhs)
|
2012-11-24 16:05:11 +00:00
|
|
|
-> decltype(
|
|
|
|
sprout::lvalue_forward<Range>(lhs) | sprout::compost::formats::left_channel
|
|
|
|
| sprout::compost::formats::stereo(sprout::lvalue_forward<Range>(lhs) | sprout::compost::formats::right_channel | rhs.adaptor())
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return sprout::lvalue_forward<Range>(lhs) | sprout::compost::formats::left_channel
|
|
|
|
| sprout::compost::formats::stereo(sprout::lvalue_forward<Range>(lhs) | sprout::compost::formats::right_channel | rhs.adaptor())
|
|
|
|
;
|
|
|
|
}
|
|
|
|
} // namespace formats
|
|
|
|
|
|
|
|
using sprout::compost::formats::effected_right_cannel;
|
|
|
|
} // namespace compost
|
|
|
|
} // namespace sprout
|
|
|
|
|
2012-11-25 01:09:41 +00:00
|
|
|
#endif // #ifndef SPROUT_COMPOST_FORMATS_EFFECTED_RIGHT_HPP
|