Unravel Engine C++ Reference
Loading...
Searching...
No Matches
seq Namespace Reference

Provides a sequence-based action management system for controlling and scheduling actions. More...

Namespaces

namespace  detail
 
namespace  ease
 
namespace  inspector
 
namespace  manager
 
namespace  scope
 

Classes

struct  seq_action
 Represents an action within the sequence management system. Contains lifecycle events and management functions. More...
 
struct  seq_inspect_info
 Contains information for inspecting and debugging sequence actions. More...
 
struct  seq_manager
 Manages and coordinates multiple sequence actions with scoping, pausing, and updating capabilities. More...
 
struct  seq_private
 Provides internal utilities for managing seq_action objects. These methods allow for direct control over actions' state, progression, and other properties. More...
 
struct  seq_scope_policy
 Defines policies for scoping actions in a sequence. More...
 
struct  values_t
 

Typedefs

using clock_t = std::chrono::steady_clock
 Alias for the steady clock used for timing actions.
 
using timepoint_t = clock_t::time_point
 Represents a point in time using the steady clock.
 
using duraiton_secs_t = std::chrono::duration<float>
 Represents a duration in seconds as a floating-point value.
 
using duration_t = std::chrono::nanoseconds
 Represents a duration in nanoseconds.
 
using sentinel_t = hpp::sentinel
 Alias for a sentinel object used for lifecycle management.
 
using seq_id_t = size_t
 Represents a unique identifier for sequence actions.
 
using ease_t = std::function<float(float)>
 Represents an easing function for interpolation.
 
template<typename T >
using interpolate_t = std::function<T(const T&, const T&, float, const ease_t&)>
 Represents a function for interpolating values.
 

Enumerations

enum class  state_t { running , paused , finished }
 Represents the state of a sequence action. More...
 

Functions

auto start (seq_action action, const seq_scope_policy &scope_policy={}, hpp::source_location location=hpp::source_location::current()) -> seq_id_t
 Starts a new action.
 
void stop (seq_id_t id)
 Stops the action associated with the given ID.
 
void pause (seq_id_t id)
 Pauses the action associated with the given ID.
 
void resume (seq_id_t id)
 Resumes the action associated with the given ID.
 
void stop_when_finished (seq_id_t id)
 Marks the action to stop when it finishes.
 
void stop_and_finish (seq_id_t id, duration_t finish_after=0ms)
 Stops the action after a specified duration.
 
auto is_stopping (seq_id_t id) -> bool
 Checks if the action is stopping.
 
auto is_running (seq_id_t id) -> bool
 Checks if the action is running.
 
auto is_paused (seq_id_t id) -> bool
 Checks if the action is paused.
 
auto is_finished (seq_id_t id) -> bool
 Checks if the action has finished.
 
auto has_action_with_scope (const std::string &scope_id) -> bool
 Checks if there is an action associated with the given scope ID.
 
void set_speed_multiplier (seq_id_t id, float speed_multiplier=1.0f)
 Sets the speed multiplier for an action.
 
auto get_speed_multiplier (seq_id_t id) -> float
 Gets the speed multiplier of an action.
 
auto get_elapsed (seq_id_t id) -> duration_t
 Gets the elapsed duration of an action.
 
void set_elapsed (seq_id_t id, duration_t duration)
 Sets the elapsed duration of an action.
 
auto get_duration (seq_id_t id) -> duration_t
 Gets the total duration of an action.
 
auto get_overflow (seq_id_t id) -> duration_t
 Gets the overflow duration of an action.
 
void update (seq_id_t id, duration_t duration)
 Updates the elapsed duration of a specific action.
 
auto get_percent (seq_id_t id) -> float
 Gets the percentage completion of an action.
 
void update (duration_t delta)
 Updates the state of all actions with a time delta.
 
void update (duraiton_secs_t delta)
 Updates the state of all actions with a time delta in seconds.
 
void shutdown ()
 Shuts down the action management system, stopping all actions.
 
auto sequence_impl (const std::vector< seq_action > &actions, const sentinel_t &sentinel, bool precise) -> seq_action
 
auto sequence (const std::vector< seq_action > &actions, const sentinel_t &sentinel=hpp::eternal_sentinel()) -> seq_action
 Creates a sequential action that executes a list of actions one after another.
 
auto sequence_precise (const std::vector< seq_action > &actions, const sentinel_t &sentinel=hpp::eternal_sentinel()) -> seq_action
 Creates a precise sequential action that executes a list of actions with exact timing.
 
auto together (const std::vector< seq_action > &actions, const sentinel_t &sentinel=hpp::eternal_sentinel()) -> seq_action
 Creates a simultaneous action that executes a list of actions together.
 
auto delay (const duration_t &duration, const sentinel_t &sentinel=hpp::eternal_sentinel()) -> seq_action
 Creates a delay action.
 
auto repeat_impl (const seq_action &action, size_t times, bool precise, const sentinel_t &sentinel=hpp::eternal_sentinel()) -> seq_action
 
auto repeat (const seq_action &action, size_t times=0) -> seq_action
 Repeats an action a specified number of times.
 
auto repeat (const seq_action &action, const sentinel_t &sentinel, size_t times=0) -> seq_action
 Repeats an action a specified number of times with a sentinel.
 
auto repeat_precise (const seq_action &action, size_t times=0) -> seq_action
 Precisely repeats an action a specified number of times.
 
auto repeat_precise (const seq_action &action, const sentinel_t &sentinel, size_t times=0) -> seq_action
 Precisely repeats an action a specified number of times with a sentinel.
 
template<typename T >
auto change_from_to (T &object, const std::decay_t< T > &begin, const std::decay_t< T > &end, const duration_t &duration, const sentinel_t &sentinel, const ease_t &ease_func=ease::linear) -> seq_action
 Creates an action to change an object from one value to another over a specified duration.
 
template<typename T >
auto change_from_to (const std::shared_ptr< T > &object, const std::decay_t< T > &begin, const std::decay_t< T > &end, const duration_t &duration, const ease_t &ease_func=ease::linear) -> seq_action
 Creates an action to change a shared object from one value to another over a specified duration.
 
template<typename T >
auto change_to (T &object, const std::decay_t< T > &end, const duration_t &duration, const sentinel_t &sentinel, const ease_t &ease_func=ease::linear) -> seq_action
 Creates an action to change an object to a specified value over a specified duration.
 
template<typename T >
auto change_to (const std::shared_ptr< T > &object, const std::decay_t< T > &end, const duration_t &duration, const ease_t &ease_func=ease::linear) -> seq_action
 Creates an action to change a shared object to a specified value over a specified duration.
 
template<typename T >
auto change_by (T &object, const std::decay_t< T > &amount, const duration_t &duration, const sentinel_t &sentinel, const ease_t &ease_func=ease::linear) -> seq_action
 Creates an action to change an object by a specified amount over a specified duration.
 
template<typename T >
auto change_by (const std::shared_ptr< T > &object, const std::decay_t< T > &amount, const duration_t &duration, const ease_t &ease_func=ease::linear) -> seq_action
 Creates an action to change a shared object by a specified amount over a specified duration.
 
template<typename... Args>
auto sequence (const seq_action &t1, const seq_action &t2, Args &&... actions) -> seq_action
 Creates a sequential action with two or more actions.
 
template<typename... Args>
auto sequence_precise (const seq_action &t1, const seq_action &t2, Args &&... actions) -> seq_action
 Creates a precise sequential action with two or more actions.
 
template<typename... Args>
auto together (const seq_action &t1, const seq_action &t2, Args &&... actions) -> seq_action
 Creates a simultaneous action with two or more actions.
 
template<typename Object , typename T , typename Setter , typename Getter >
seq_action create_from_to_impl (const std::string &creator_name, Object *object, const T &begin, const T &end, const Setter &setter_func, const Getter &getter_func, const duration_t &duration, const sentinel_t &sentinel, const ease_t &ease_func)
 
template<typename Object , typename T , typename Setter , typename Getter >
seq_action create_to_impl (const std::string &creator_name, Object *object, const T &end, const Setter &setter_func, const Getter &getter_func, const duration_t &duration, const sentinel_t &sentinel, const ease_t &ease_func)
 
template<typename Object , typename T , typename Setter , typename Getter >
seq_action create_by_impl (const std::string &creator_name, Object *object, const T &amount, const Setter &setter_func, const Getter &getter_func, const duration_t &duration, const sentinel_t &sentinel, const ease_t &ease_func)
 
auto square (float x, int n) -> float
 Computes the square of a number raised to a power.
 
auto flip (float x) -> float
 Flips a normalized value (1.0 becomes 0.0, 0.0 becomes 1.0).
 
auto mix (float a, float b, float weight, float t) -> float
 Mixes two values based on a weighted progress factor.
 
auto crossfade (float a, float b, float t) -> float
 Creates a crossfade effect between two values based on progress.
 
auto scale (float a, float t) -> float
 Scales a value by a factor.
 
auto reverse_scale (float a, float t) -> float
 Scales a value in reverse by a factor.
 
auto arch (float t) -> float
 Computes an arch effect (parabolic curve) based on progress.
 
template<typename T >
auto lerp (const T &start, const T &end, float progress, const ease_t &ease_func=ease::linear) -> T
 Linearly interpolates between two values based on progress.
 
template<typename InType , typename OutType >
auto range_map (const InType &in, const decltype(in)&in_start, const decltype(in)&in_end, const OutType &out_start, const decltype(out_start)&out_end, const ease_t &ease_func=ease::linear) -> OutType
 Maps a value from one range to another range, with optional easing.
 
template<typename T >
auto clamp (const T &value, const T &min, const T &max) -> T
 Clamps a value to lie between a minimum and maximum.
 
template<typename Object , typename TargetType , typename InitializeFunc , typename UpdateFunc , typename Getter >
auto create_action_updater (Object *object, const TargetType &end, const sentinel_t &sentinel, InitializeFunc &&initialize_func, UpdateFunc &&update_func, Getter &&getter, const ease_t &ease_func=ease::linear, const interpolate_t< TargetType > &interpolate=lerp< TargetType >)
 
void seq_update (seq::duration_t duration)
 
template<typename T >
void core_seq_test_impl (seq::seq_action &action, seq::duration_t duration, bool step_update, const values_t< T > &values, const T &begin, const T &end)
 
template<typename T >
seq::seq_action creator (const std::string &type, values_t< T > &values, T &begin, const T &end, seq::duration_t duration)
 
template<typename T >
void scenario (bool use_shared_ptr, bool step_update, const std::string &type, seq::duration_t duration, T begin, T end, T object_value)
 
template<typename T >
void core_seq_test (const std::string &type, const std::string &easing_type, seq::duration_t duration, T begin, T end, T object_value)
 
template<typename T >
void run_seq_test (const std::string &type, const std::string &easing_type, const T &begin, const T &end, const T &object)
 
void test_scopes ()
 
void run (bool use_random_inputs)
 

Variables

seq_id_t unique_id = 1
 
int SEQ_UPDATE_STEP_COUNT = 10
 
seq::ease_t EASING = seq::ease::linear
 

Detailed Description

Provides a sequence-based action management system for controlling and scheduling actions.

Provides mathematical utilities for interpolation, scaling, and easing functions.

Provides a sequence-based action management framework.

Provides functions for creating and managing sequence-based animations and transitions.

Provides a sequence management framework with utilities for time management, interpolation, and inspection.

Provides a sequence-based action management system for defining, updating, and managing actions.

Typedef Documentation

◆ clock_t

using seq::clock_t = std::chrono::steady_clock

Alias for the steady clock used for timing actions.

Definition at line 23 of file seq_common.h.

◆ duraiton_secs_t

using seq::duraiton_secs_t = std::chrono::duration<float>

Represents a duration in seconds as a floating-point value.

Definition at line 35 of file seq_common.h.

◆ duration_t

using seq::duration_t = std::chrono::nanoseconds

Represents a duration in nanoseconds.

Definition at line 41 of file seq_common.h.

◆ ease_t

using seq::ease_t = std::function<float(float)>

Represents an easing function for interpolation.

Parameters
tA normalized time value (0 to 1).
Returns
The eased value.

Definition at line 61 of file seq_common.h.

◆ interpolate_t

template<typename T >
using seq::interpolate_t = std::function<T(const T&, const T&, float, const ease_t&)>

Represents a function for interpolating values.

Template Parameters
TThe type of value to interpolate.
Parameters
startThe starting value.
endThe ending value.
tA normalized time value (0 to 1).
easeThe easing function to apply.
Returns
The interpolated value.

Definition at line 74 of file seq_common.h.

◆ sentinel_t

using seq::sentinel_t = hpp::sentinel

Alias for a sentinel object used for lifecycle management.

Definition at line 47 of file seq_common.h.

◆ seq_id_t

using seq::seq_id_t = size_t

Represents a unique identifier for sequence actions.

Definition at line 53 of file seq_common.h.

◆ timepoint_t

using seq::timepoint_t = clock_t::time_point

Represents a point in time using the steady clock.

Definition at line 29 of file seq_common.h.

Enumeration Type Documentation

◆ state_t

enum class seq::state_t
strong

Represents the state of a sequence action.

Enumerator
running 

The action is running.

paused 

The action is paused.

finished 

The action has finished.

Definition at line 80 of file seq_common.h.

Function Documentation

◆ arch()

auto seq::arch ( float t) -> float

Computes an arch effect (parabolic curve) based on progress.

Parameters
tThe progress factor (0.0f to 1.0f).
Returns
The arch value.

Definition at line 40 of file seq_math.cpp.

◆ change_by() [1/2]

template<typename T >
auto seq::change_by ( const std::shared_ptr< T > & object,
const std::decay_t< T > & amount,
const duration_t & duration,
const ease_t & ease_func = ease::linear ) -> seq_action

Creates an action to change a shared object by a specified amount over a specified duration.

Template Parameters
TThe type of the shared object being modified.
Parameters
objectThe shared object to modify.
amountThe amount to change by.
durationThe duration of the change.
ease_funcThe easing function to apply (default is linear easing).
Returns
A seq_action representing the change operation.

Definition at line 188 of file seq_core.hpp.

◆ change_by() [2/2]

template<typename T >
auto seq::change_by ( T & object,
const std::decay_t< T > & amount,
const duration_t & duration,
const sentinel_t & sentinel,
const ease_t & ease_func = ease::linear ) -> seq_action

Creates an action to change an object by a specified amount over a specified duration.

Template Parameters
TThe type of the object being modified.
Parameters
objectThe object to modify.
amountThe amount to change by.
durationThe duration of the change.
sentinelA sentinel for managing the action lifecycle.
ease_funcThe easing function to apply (default is linear easing).
Returns
A seq_action representing the change operation.

Definition at line 139 of file seq_core.hpp.

◆ change_from_to() [1/2]

template<typename T >
auto seq::change_from_to ( const std::shared_ptr< T > & object,
const std::decay_t< T > & begin,
const std::decay_t< T > & end,
const duration_t & duration,
const ease_t & ease_func = ease::linear ) -> seq_action

Creates an action to change a shared object from one value to another over a specified duration.

Template Parameters
TThe type of the shared object being modified.
Parameters
objectThe shared object to modify.
beginThe starting value.
endThe ending value.
durationThe duration of the change.
ease_funcThe easing function to apply (default is linear easing).
Returns
A seq_action representing the change operation.

Definition at line 62 of file seq_core.hpp.

◆ change_from_to() [2/2]

template<typename T >
auto seq::change_from_to ( T & object,
const std::decay_t< T > & begin,
const std::decay_t< T > & end,
const duration_t & duration,
const sentinel_t & sentinel,
const ease_t & ease_func = ease::linear ) -> seq_action

Creates an action to change an object from one value to another over a specified duration.

Template Parameters
TThe type of the object being modified.
Parameters
objectThe object to modify.
beginThe starting value.
endThe ending value.
durationThe duration of the change.
sentinelA sentinel for managing the action lifecycle.
ease_funcThe easing function to apply (default is linear easing).
Returns
A seq_action representing the change operation.

Definition at line 11 of file seq_core.hpp.

◆ change_to() [1/2]

template<typename T >
auto seq::change_to ( const std::shared_ptr< T > & object,
const std::decay_t< T > & end,
const duration_t & duration,
const ease_t & ease_func = ease::linear ) -> seq_action

Creates an action to change a shared object to a specified value over a specified duration.

Template Parameters
TThe type of the shared object being modified.
Parameters
objectThe shared object to modify.
endThe target value.
durationThe duration of the change.
ease_funcThe easing function to apply (default is linear easing).
Returns
A seq_action representing the change operation.

Definition at line 126 of file seq_core.hpp.

◆ change_to() [2/2]

template<typename T >
auto seq::change_to ( T & object,
const std::decay_t< T > & end,
const duration_t & duration,
const sentinel_t & sentinel,
const ease_t & ease_func = ease::linear ) -> seq_action

Creates an action to change an object to a specified value over a specified duration.

Template Parameters
TThe type of the object being modified.
Parameters
objectThe object to modify.
endThe target value.
durationThe duration of the change.
sentinelA sentinel for managing the action lifecycle.
ease_funcThe easing function to apply (default is linear easing).
Returns
A seq_action representing the change operation.

Definition at line 76 of file seq_core.hpp.

◆ clamp()

template<typename T >
auto seq::clamp ( const T & value,
const T & min,
const T & max ) -> T

Clamps a value to lie between a minimum and maximum.

Template Parameters
TThe type of the value.
Parameters
valueThe value to clamp.
minThe minimum bound.
maxThe maximum bound.
Returns
The clamped value.

Definition at line 54 of file seq_math.h.

◆ core_seq_test()

template<typename T >
void seq::core_seq_test ( const std::string & type,
const std::string & easing_type,
seq::duration_t duration,
T begin,
T end,
T object_value )

Definition at line 887 of file tests.cpp.

◆ core_seq_test_impl()

template<typename T >
void seq::core_seq_test_impl ( seq::seq_action & action,
seq::duration_t duration,
bool step_update,
const values_t< T > & values,
const T & begin,
const T & end )

Definition at line 63 of file tests.cpp.

◆ create_action_updater()

template<typename Object , typename TargetType , typename InitializeFunc , typename UpdateFunc , typename Getter >
auto seq::create_action_updater ( Object * object,
const TargetType & end,
const sentinel_t & sentinel,
InitializeFunc && initialize_func,
UpdateFunc && update_func,
Getter && getter,
const ease_t & ease_func = ease::linear,
const interpolate_t< TargetType > & interpolate = lerp<TargetType> )

Definition at line 11 of file seq_updater.h.

◆ create_by_impl()

template<typename Object , typename T , typename Setter , typename Getter >
seq_action seq::create_by_impl ( const std::string & creator_name,
Object * object,
const T & amount,
const Setter & setter_func,
const Getter & getter_func,
const duration_t & duration,
const sentinel_t & sentinel,
const ease_t & ease_func )

Definition at line 129 of file seq_ex.h.

◆ create_from_to_impl()

template<typename Object , typename T , typename Setter , typename Getter >
seq_action seq::create_from_to_impl ( const std::string & creator_name,
Object * object,
const T & begin,
const T & end,
const Setter & setter_func,
const Getter & getter_func,
const duration_t & duration,
const sentinel_t & sentinel,
const ease_t & ease_func )

Definition at line 13 of file seq_ex.h.

◆ create_to_impl()

template<typename Object , typename T , typename Setter , typename Getter >
seq_action seq::create_to_impl ( const std::string & creator_name,
Object * object,
const T & end,
const Setter & setter_func,
const Getter & getter_func,
const duration_t & duration,
const sentinel_t & sentinel,
const ease_t & ease_func )

Definition at line 70 of file seq_ex.h.

◆ creator()

template<typename T >
seq::seq_action seq::creator ( const std::string & type,
values_t< T > & values,
T & begin,
const T & end,
seq::duration_t duration )

Definition at line 195 of file tests.cpp.

◆ crossfade()

auto seq::crossfade ( float a,
float b,
float t ) -> float

Creates a crossfade effect between two values based on progress.

Parameters
aThe first value.
bThe second value.
tThe progress factor (0.0f to 1.0f).
Returns
The crossfaded value.

Definition at line 25 of file seq_math.cpp.

◆ delay()

auto seq::delay ( const duration_t & duration,
const sentinel_t & sentinel = hpp::eternal_sentinel() ) -> seq_action

Creates a delay action.

Parameters
durationThe duration of the delay.
sentinelA sentinel for managing the action lifecycle (default is eternal).
Returns
A seq_action representing the delay.

Definition at line 182 of file seq_core.cpp.

◆ flip()

auto seq::flip ( float x) -> float

Flips a normalized value (1.0 becomes 0.0, 0.0 becomes 1.0).

Parameters
xThe normalized value to flip.
Returns
The flipped value.

Definition at line 14 of file seq_math.cpp.

◆ get_duration()

auto seq::get_duration ( seq_id_t id) -> duration_t

Gets the total duration of an action.

Parameters
idThe ID of the action.
Returns
The total duration.

Definition at line 84 of file seq.cpp.

◆ get_elapsed()

auto seq::get_elapsed ( seq_id_t id) -> duration_t

Gets the elapsed duration of an action.

Parameters
idThe ID of the action.
Returns
The elapsed duration.

Definition at line 74 of file seq.cpp.

◆ get_overflow()

auto seq::get_overflow ( seq_id_t id) -> duration_t

Gets the overflow duration of an action.

Parameters
idThe ID of the action.
Returns
The overflow duration.

Definition at line 89 of file seq.cpp.

◆ get_percent()

auto seq::get_percent ( seq_id_t id) -> float

Gets the percentage completion of an action.

Parameters
idThe ID of the action.
Returns
The percentage completion as a float.

Definition at line 99 of file seq.cpp.

◆ get_speed_multiplier()

auto seq::get_speed_multiplier ( seq_id_t id) -> float

Gets the speed multiplier of an action.

Parameters
idThe ID of the action.
Returns
The current speed multiplier.

Definition at line 69 of file seq.cpp.

◆ has_action_with_scope()

auto seq::has_action_with_scope ( const std::string & scope_id) -> bool

Checks if there is an action associated with the given scope ID.

Parameters
scope_idThe scope ID to check.
Returns
True if an action exists with the given scope ID, false otherwise.

Definition at line 59 of file seq.cpp.

◆ is_finished()

auto seq::is_finished ( seq_id_t id) -> bool

Checks if the action has finished.

Parameters
idThe ID of the action to check.
Returns
True if the action has finished, false otherwise.

Definition at line 54 of file seq.cpp.

◆ is_paused()

auto seq::is_paused ( seq_id_t id) -> bool

Checks if the action is paused.

Parameters
idThe ID of the action to check.
Returns
True if the action is paused, false otherwise.

Definition at line 49 of file seq.cpp.

◆ is_running()

auto seq::is_running ( seq_id_t id) -> bool

Checks if the action is running.

Parameters
idThe ID of the action to check.
Returns
True if the action is running, false otherwise.

Definition at line 44 of file seq.cpp.

◆ is_stopping()

auto seq::is_stopping ( seq_id_t id) -> bool

Checks if the action is stopping.

Parameters
idThe ID of the action to check.
Returns
True if the action is stopping, false otherwise.

Definition at line 39 of file seq.cpp.

◆ lerp()

template<typename T >
auto seq::lerp ( const T & start,
const T & end,
float progress,
const ease_t & ease_func = ease::linear ) -> T

Linearly interpolates between two values based on progress.

Template Parameters
TThe type of the values to interpolate.
Parameters
startThe starting value.
endThe ending value.
progressThe progress factor (0.0f to 1.0f).
ease_funcThe easing function to apply (default is linear easing).
Returns
The interpolated value.

Definition at line 8 of file seq_math.hpp.

◆ mix()

auto seq::mix ( float a,
float b,
float weight,
float t ) -> float

Mixes two values based on a weighted progress factor.

Parameters
aThe first value.
bThe second value.
weightThe weight of the mix.
tThe progress factor (0.0f to 1.0f).
Returns
The mixed value.

Definition at line 19 of file seq_math.cpp.

◆ pause()

void seq::pause ( seq_id_t id)

Pauses the action associated with the given ID.

Parameters
idThe ID of the action to pause.

Definition at line 19 of file seq.cpp.

◆ range_map()

template<typename InType , typename OutType >
auto seq::range_map ( const InType & in,
const decltype(in)& in_start,
const decltype(in)& in_end,
const OutType & out_start,
const decltype(out_start)& out_end,
const ease_t & ease_func = ease::linear ) -> OutType

Maps a value from one range to another range, with optional easing.

Template Parameters
InTypeThe type of the input range values.
OutTypeThe type of the output range values.
Parameters
inThe input value.
in_startThe start of the input range.
in_endThe end of the input range.
out_startThe start of the output range.
out_endThe end of the output range.
ease_funcThe easing function to apply (default is linear easing).
Returns
The mapped value in the output range.

Definition at line 25 of file seq_math.hpp.

◆ repeat() [1/2]

auto seq::repeat ( const seq_action & action,
const sentinel_t & sentinel,
size_t times = 0 ) -> seq_action

Repeats an action a specified number of times with a sentinel.

Parameters
actionThe action to repeat.
sentinelA sentinel for managing the action lifecycle.
timesThe number of times to repeat the action (default is infinite if 0).
Returns
A seq_action representing the repeated action.

Definition at line 321 of file seq_core.cpp.

◆ repeat() [2/2]

auto seq::repeat ( const seq_action & action,
size_t times = 0 ) -> seq_action

Repeats an action a specified number of times.

Parameters
actionThe action to repeat.
timesThe number of times to repeat the action (default is infinite if 0).
Returns
A seq_action representing the repeated action.

Definition at line 316 of file seq_core.cpp.

◆ repeat_impl()

auto seq::repeat_impl ( const seq_action & action,
size_t times,
bool precise,
const sentinel_t & sentinel = hpp::eternal_sentinel() ) -> seq_action

Definition at line 221 of file seq_core.cpp.

◆ repeat_precise() [1/2]

auto seq::repeat_precise ( const seq_action & action,
const sentinel_t & sentinel,
size_t times = 0 ) -> seq_action

Precisely repeats an action a specified number of times with a sentinel.

Parameters
actionThe action to repeat.
sentinelA sentinel for managing the action lifecycle.
timesThe number of times to repeat the action (default is infinite if 0).
Returns
A seq_action representing the precise repeated action.

Definition at line 331 of file seq_core.cpp.

◆ repeat_precise() [2/2]

auto seq::repeat_precise ( const seq_action & action,
size_t times = 0 ) -> seq_action

Precisely repeats an action a specified number of times.

Parameters
actionThe action to repeat.
timesThe number of times to repeat the action (default is infinite if 0).
Returns
A seq_action representing the precise repeated action.

Definition at line 326 of file seq_core.cpp.

◆ resume()

void seq::resume ( seq_id_t id)

Resumes the action associated with the given ID.

Parameters
idThe ID of the action to resume.

Definition at line 24 of file seq.cpp.

◆ reverse_scale()

auto seq::reverse_scale ( float a,
float t ) -> float

Scales a value in reverse by a factor.

Parameters
aThe value to scale.
tThe scaling factor.
Returns
The reverse-scaled value.

Definition at line 35 of file seq_math.cpp.

◆ run()

void seq::run ( bool use_random_inputs)

Definition at line 1093 of file tests.cpp.

◆ run_seq_test()

template<typename T >
void seq::run_seq_test ( const std::string & type,
const std::string & easing_type,
const T & begin,
const T & end,
const T & object )

Definition at line 919 of file tests.cpp.

◆ scale()

auto seq::scale ( float a,
float t ) -> float

Scales a value by a factor.

Parameters
aThe value to scale.
tThe scaling factor.
Returns
The scaled value.

Definition at line 30 of file seq_math.cpp.

◆ scenario()

template<typename T >
void seq::scenario ( bool use_shared_ptr,
bool step_update,
const std::string & type,
seq::duration_t duration,
T begin,
T end,
T object_value )

Definition at line 237 of file tests.cpp.

◆ seq_update()

void seq::seq_update ( seq::duration_t duration)
inline

Definition at line 13 of file tests.cpp.

◆ sequence() [1/2]

template<typename... Args>
auto seq::sequence ( const seq_action & t1,
const seq_action & t2,
Args &&... actions ) -> seq_action

Creates a sequential action with two or more actions.

Template Parameters
ArgsAdditional actions.
Parameters
t1The first action.
t2The second action.
actionsAdditional actions to include in the sequence.
Returns
A seq_action representing the sequence.

Definition at line 141 of file seq_core.h.

◆ sequence() [2/2]

auto seq::sequence ( const std::vector< seq_action > & actions,
const sentinel_t & sentinel = hpp::eternal_sentinel() ) -> seq_action

Creates a sequential action that executes a list of actions one after another.

Parameters
actionsThe list of actions to execute sequentially.
sentinelA sentinel for managing the action lifecycle (default is eternal).
Returns
A seq_action representing the sequence.

Definition at line 99 of file seq_core.cpp.

◆ sequence_impl()

auto seq::sequence_impl ( const std::vector< seq_action > & actions,
const sentinel_t & sentinel,
bool precise ) -> seq_action

Definition at line 7 of file seq_core.cpp.

◆ sequence_precise() [1/2]

template<typename... Args>
auto seq::sequence_precise ( const seq_action & t1,
const seq_action & t2,
Args &&... actions ) -> seq_action

Creates a precise sequential action with two or more actions.

Template Parameters
ArgsAdditional actions.
Parameters
t1The first action.
t2The second action.
actionsAdditional actions to include in the sequence.
Returns
A seq_action representing the precise sequence.

Definition at line 155 of file seq_core.h.

◆ sequence_precise() [2/2]

auto seq::sequence_precise ( const std::vector< seq_action > & actions,
const sentinel_t & sentinel = hpp::eternal_sentinel() ) -> seq_action

Creates a precise sequential action that executes a list of actions with exact timing.

Parameters
actionsThe list of actions to execute sequentially.
sentinelA sentinel for managing the action lifecycle (default is eternal).
Returns
A seq_action representing the precise sequence.

Definition at line 104 of file seq_core.cpp.

◆ set_elapsed()

void seq::set_elapsed ( seq_id_t id,
duration_t duration )

Sets the elapsed duration of an action.

Parameters
idThe ID of the action.
durationThe elapsed duration to set.

Definition at line 79 of file seq.cpp.

◆ set_speed_multiplier()

void seq::set_speed_multiplier ( seq_id_t id,
float speed_multiplier = 1.0f )

Sets the speed multiplier for an action.

Parameters
idThe ID of the action.
speed_multiplierThe speed multiplier to set (default is 1.0f).

Definition at line 64 of file seq.cpp.

◆ shutdown()

void seq::shutdown ( )

Shuts down the action management system, stopping all actions.

Definition at line 122 of file seq.cpp.

◆ square()

auto seq::square ( float x,
int n ) -> float

Computes the square of a number raised to a power.

Parameters
xThe base value.
nThe exponent.
Returns
The squared value.

Definition at line 5 of file seq_math.cpp.

◆ start()

auto seq::start ( seq_action action,
const seq_scope_policy & scope_policy = {},
hpp::source_location location = hpp::source_location::current() ) -> seq_id_t

Starts a new action.

Parameters
actionThe action to be started.
scope_policyThe policy for the scope of the action (default is empty).
locationThe source location where this function is called (default is the current location).
Returns
A unique ID representing the started action.

Definition at line 8 of file seq.cpp.

◆ stop()

void seq::stop ( seq_id_t id)

Stops the action associated with the given ID.

Parameters
idThe ID of the action to stop.

Definition at line 14 of file seq.cpp.

◆ stop_and_finish()

void seq::stop_and_finish ( seq_id_t id,
duration_t finish_after = 0ms )

Stops the action after a specified duration.

Parameters
idThe ID of the action to stop.
finish_afterThe duration to wait before stopping (default is 0ms).

Definition at line 34 of file seq.cpp.

◆ stop_when_finished()

void seq::stop_when_finished ( seq_id_t id)

Marks the action to stop when it finishes.

Parameters
idThe ID of the action to modify.

Definition at line 29 of file seq.cpp.

◆ test_scopes()

void seq::test_scopes ( )

Definition at line 930 of file tests.cpp.

◆ together() [1/2]

template<typename... Args>
auto seq::together ( const seq_action & t1,
const seq_action & t2,
Args &&... actions ) -> seq_action

Creates a simultaneous action with two or more actions.

Template Parameters
ArgsAdditional actions.
Parameters
t1The first action.
t2The second action.
actionsAdditional actions to include in the simultaneous action.
Returns
A seq_action representing the simultaneous action.

Definition at line 178 of file seq_core.h.

◆ together() [2/2]

auto seq::together ( const std::vector< seq_action > & actions,
const sentinel_t & sentinel = hpp::eternal_sentinel() ) -> seq_action

Creates a simultaneous action that executes a list of actions together.

Parameters
actionsThe list of actions to execute together.
sentinelA sentinel for managing the action lifecycle (default is eternal).
Returns
A seq_action representing the simultaneous action.

Definition at line 109 of file seq_core.cpp.

◆ update() [1/3]

void seq::update ( duraiton_secs_t delta)

Updates the state of all actions with a time delta in seconds.

Parameters
deltaThe time delta in seconds.

Definition at line 116 of file seq.cpp.

◆ update() [2/3]

void seq::update ( duration_t delta)

Updates the state of all actions with a time delta.

Parameters
deltaThe time delta to update with.

Definition at line 111 of file seq.cpp.

◆ update() [3/3]

void seq::update ( seq_id_t id,
duration_t duration )

Updates the elapsed duration of a specific action.

Parameters
idThe ID of the action.
durationThe duration to update with.

Definition at line 94 of file seq.cpp.

Variable Documentation

◆ EASING

Definition at line 11 of file tests.cpp.

◆ SEQ_UPDATE_STEP_COUNT

int seq::SEQ_UPDATE_STEP_COUNT = 10

Definition at line 10 of file tests.cpp.

◆ unique_id

seq_id_t seq::unique_id = 1

Definition at line 6 of file seq_action.cpp.