23namespace ossia::pipewire
31 std::uint32_t expected{};
32 std::uint32_t last_seen{};
34 enum class event : std::uint8_t
42 constexpr event observe(std::uint32_t value)
noexcept
44 if (value == last_seen)
46 const auto prev = last_seen;
48 if (value == expected)
49 return prev == 0 ? event::matched : event::recovered;
50 return event::mismatch;
60for_each_chunk(std::uint32_t nframes, std::uint32_t max_frames, F&& f)
64 for (std::uint32_t offset = 0; offset < nframes;)
67 = nframes - offset < max_frames ? nframes - offset : max_frames;
77inline void assign_chunk_pointers(
78 float*
const* cycle,
float** chunk, std::size_t channels,
79 std::uint32_t offset,
float* scratch)
noexcept
81 for (std::size_t i = 0; i < channels; ++i)
82 chunk[i] = cycle[i] ? cycle[i] + offset : scratch;