54 : samples_to_wait(samples)
66 [[nodiscard]]
inline bool await_ready()
const {
return samples_to_wait == 0; }
85 void await_suspend(std::coroutine_handle<promise_handle> h)
noexcept;
121 [[nodiscard]]
constexpr bool await_ready() const noexcept {
return num_cycles == 0; }
125 auto& promise = h.promise();
126 promise.next_buffer_cycle += num_cycles;
127 promise.delay_amount = num_cycles;
128 promise.active_delay_context = Vruta::DelayContext::BUFFER_BASED;
154 return frames_to_wait == 0;
159 void await_suspend(std::coroutine_handle<Vruta::graphics_promise> h)
noexcept;
169 return samples_to_wait == 0 && frames_to_wait == 0;
174 void await_suspend(std::coroutine_handle<Vruta::complex_promise> h)
noexcept;
187template <
typename PromiseType>
209 promise_ptr = &h.promise();
210 h.promise().active_delay_context = Vruta::DelayContext::AWAIT;
303 void await_suspend(
std::coroutine_handle<> handle);
308 Core::WindowEvent await_resume();
316 Vruta::EventSource& m_source;
317 std::optional<Core::WindowEventType> m_filter;
318 Core::WindowEvent m_result;
319 std::coroutine_handle<> m_handle;
320 bool m_is_suspended = false;
322 friend class Vruta::EventSource;
EventAwaiter & operator=(const EventAwaiter &)=delete
EventAwaiter(EventAwaiter &&) noexcept=default
EventAwaiter(Vruta::EventSource &source, std::optional< Core::WindowEventType > filter=std::nullopt)
EventAwaiter(const EventAwaiter &)=delete
Awaiter for suspending on window events.
Awaitable event stream for window events.
constexpr void await_resume() const noexcept
void await_suspend(std::coroutine_handle< promise_handle > h) noexcept
BufferDelay(uint64_t cycles)
constexpr bool await_ready() const noexcept
Awaiter for suspending until a buffer cycle boundary.
constexpr bool await_ready() const noexcept
constexpr void await_resume() const noexcept
graphics-domain awaiter for frame-accurate timing delays
promise_handle & await_resume() const noexcept
bool await_ready() const noexcept
void await_suspend(std::coroutine_handle< promise_handle > h) noexcept
PromiseType promise_handle
Templated awaitable for accessing a coroutine's promise object.
constexpr void await_resume() const noexcept
constexpr bool await_ready() const noexcept
uint64_t samples_to_wait
Number of time units to wait before resuming the coroutine.
void await_resume()
Called when the coroutine is resumed after the delay.
SampleDelay(uint64_t samples)
bool await_ready() const
Checks if the delay should be bypassed.
Awaitable object for precise sample-accurate timing delays.
Coroutine promise type for audio processing tasks with sample-accurate timing.
Coroutine promise type for graphics processing tasks with frame-accurate timing.