Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::StagedTransition Class Reference

#include <staged_transition.hpp>

Public Member Functions

void begin (int total_steps) noexcept
 Schedule total_steps steps; runs nothing.
void cancel () noexcept
 Drop the schedule without running the remaining steps.
template<typename Step>
int run_due (std::int64_t elapsed, std::int64_t horizon, Step &&step)
 Run every step due by elapsed of horizon (see due_steps()).
template<typename Step>
int run_next (int count, Step &&step)
 Run up to count further steps. Returns the number run.
template<typename Step>
int finish_now (Step &&step)
 Run every remaining step now (for a consumer that needs the finished state immediately).
bool active () const noexcept
int total () const noexcept
int completed () const noexcept
int remaining () const noexcept

Static Public Member Functions

static constexpr int due_steps (int total, std::int64_t elapsed, std::int64_t horizon) noexcept
 Steps that must have completed once elapsed of horizon units have passed: ceil(total * elapsed / horizon), clamped to [0, total].

Member Function Documentation

◆ active()

bool pulp::signal::StagedTransition::active ( ) const
inlinenoexcept

◆ begin()

void pulp::signal::StagedTransition::begin ( int total_steps)
inlinenoexcept

Schedule total_steps steps; runs nothing.

Replaces any schedule in progress (its remaining steps are dropped).

◆ cancel()

void pulp::signal::StagedTransition::cancel ( )
inlinenoexcept

Drop the schedule without running the remaining steps.

◆ completed()

int pulp::signal::StagedTransition::completed ( ) const
inlinenoexcept

◆ due_steps()

constexpr int pulp::signal::StagedTransition::due_steps ( int total,
std::int64_t elapsed,
std::int64_t horizon )
inlinestaticconstexprnoexcept

Steps that must have completed once elapsed of horizon units have passed: ceil(total * elapsed / horizon), clamped to [0, total].

A non-positive horizon means "all of it now". Pure.

◆ finish_now()

template<typename Step>
int pulp::signal::StagedTransition::finish_now ( Step && step)
inline

Run every remaining step now (for a consumer that needs the finished state immediately).

Returns the number run.

◆ remaining()

int pulp::signal::StagedTransition::remaining ( ) const
inlinenoexcept

◆ run_due()

template<typename Step>
int pulp::signal::StagedTransition::run_due ( std::int64_t elapsed,
std::int64_t horizon,
Step && step )
inline

Run every step due by elapsed of horizon (see due_steps()).

Returns the number of steps run.

◆ run_next()

template<typename Step>
int pulp::signal::StagedTransition::run_next ( int count,
Step && step )
inline

Run up to count further steps. Returns the number run.

◆ total()

int pulp::signal::StagedTransition::total ( ) const
inlinenoexcept

The documentation for this class was generated from the following file: