24#ifndef SBL_CONTROL_PARAM_ECHO_HPP_
25#define SBL_CONTROL_PARAM_ECHO_HPP_
37template<
typename Target>
43 void request() { requested_.store(
true, std::memory_order_relaxed); }
46 bool pending()
const {
return requested_.load(std::memory_order_relaxed) || next_ < count_; }
55 template<
typename ValueOf,
typename Send>
56 size_t poll(uint8_t channel, ValueOf&& value_of, Send&& send) {
58 if (requested_.load(std::memory_order_relaxed)) {
59 requested_.store(
false, std::memory_order_relaxed);
63 while (next_ < count_) {
79 std::atomic<bool> requested_{
false};
Declarative MIDI CC routing.
Routes MIDI CCs to app targets through a constexpr table.
size_t size() const
Rows in the map.
const CcEntry< Target > * begin() const
The first row, for a walk over them (an echo of the targets' values, a listing)
size_t poll(uint8_t channel, ValueOf &&value_of, Send &&send)
The control stack: scheduler, event queue, merge, CC mapping, calibration.
constexpr T clamp01(T x)
x held to [0, 1]; a NaN goes to 0.
constexpr uint8_t to_7bit(float value)
static constexpr MidiEvent control_change(uint8_t channel, uint8_t number, uint8_t value)
A Control Change event: channel 0-15, controller number and value 0-127.