Unravel Engine C++ Reference
Loading...
Searching...
No Matches
seq.h
Go to the documentation of this file.
1#pragma once
2#include "seq_core.h"
3#include "seq_manager.h"
4#include <hpp/source_location.hpp>
5
10namespace seq
11{
19auto start(seq_action action,
20 const seq_scope_policy& scope_policy = {},
21 hpp::source_location location = hpp::source_location::current()) -> seq_id_t;
22
27void stop(seq_id_t id);
28
33void pause(seq_id_t id);
34
39void resume(seq_id_t id);
40
46
52void stop_and_finish(seq_id_t id, duration_t finish_after = 0ms);
53
58void update(duration_t delta);
59
64void update(duraiton_secs_t delta);
65
69void shutdown();
70
76auto is_stopping(seq_id_t id) -> bool;
77
83auto is_running(seq_id_t id) -> bool;
84
90auto is_paused(seq_id_t id) -> bool;
91
97auto is_finished(seq_id_t id) -> bool;
98
104auto has_action_with_scope(const std::string& scope_id) -> bool;
105
111void set_speed_multiplier(seq_id_t id, float speed_multiplier = 1.0f);
112
118auto get_speed_multiplier(seq_id_t id) -> float;
119
126
132void set_elapsed(seq_id_t id, duration_t duration);
133
139void update(seq_id_t id, duration_t duration);
140
147
154
160auto get_percent(seq_id_t id) -> float;
161
162namespace manager
163{
168void push(seq_manager& mgr);
169
173void pop();
174} // namespace manager
175
176namespace scope
177{
182void push(const std::string& scope);
183
188void close(const std::string& scope);
189
193void pop();
194
198void clear();
199
204auto get_current() -> const std::string&;
205
210void stop_all(const std::string& scope);
211
216void pause_all(const std::string& scope);
217
222void resume_all(const std::string& scope);
223
229void pause_all(const std::string& scope, const std::string& key);
230
236void resume_all(const std::string& scope, const std::string& key);
237
242void stop_and_finish_all(const std::string& scope);
243
248void stop_when_finished_all(const std::string& scope);
249} // namespace scope
250
251} // namespace seq
void pop()
Pops the top sequence manager from the stack.
Definition seq.cpp:197
void push(seq_manager &mgr)
Pushes a sequence manager to the stack.
Definition seq.cpp:193
void pause_all(const std::string &scope)
Pauses all actions within the specified scope.
Definition seq.cpp:159
void stop_when_finished_all(const std::string &scope)
Marks all actions within the specified scope to stop when they finish.
Definition seq.cpp:184
void push(const std::string &scope)
Pushes a new scope to the stack.
Definition seq.cpp:129
void stop_all(const std::string &scope)
Stops all actions within the specified scope.
Definition seq.cpp:154
auto get_current() -> const std::string &
Gets the name of the current scope.
Definition seq.cpp:149
void pop()
Pops the current scope from the stack.
Definition seq.cpp:134
void close(const std::string &scope)
Closes the specified scope.
Definition seq.cpp:139
void clear()
Clears all scopes from the stack.
Definition seq.cpp:144
void resume_all(const std::string &scope)
Resumes all actions within the specified scope.
Definition seq.cpp:164
void stop_and_finish_all(const std::string &scope)
Stops and finishes all actions within the specified scope.
Definition seq.cpp:179
Provides a sequence-based action management system for controlling and scheduling actions.
size_t seq_id_t
Represents a unique identifier for sequence actions.
Definition seq_common.h:53
void update(seq_id_t id, duration_t delta)
Updates the elapsed duration of a specific action.
Definition seq.cpp:94
auto is_finished(seq_id_t id) -> bool
Checks if the action has finished.
Definition seq.cpp:54
std::chrono::duration< float > duraiton_secs_t
Represents a duration in seconds as a floating-point value.
Definition seq_common.h:35
void set_elapsed(seq_id_t id, duration_t duration)
Sets the elapsed duration of an action.
Definition seq.cpp:79
auto is_paused(seq_id_t id) -> bool
Checks if the action is paused.
Definition seq.cpp:49
void resume(const seq_id_t id)
Resumes the action associated with the given ID.
Definition seq.cpp:24
auto start(seq_action action, const seq_scope_policy &scope_policy, hpp::source_location location) -> seq_id_t
Starts a new action.
Definition seq.cpp:8
auto get_duration(seq_id_t id) -> duration_t
Gets the total duration of an action.
Definition seq.cpp:84
auto get_overflow(seq_id_t id) -> duration_t
Gets the overflow duration of an action.
Definition seq.cpp:89
void stop_and_finish(seq_id_t id, duration_t finish_after)
Stops the action after a specified duration.
Definition seq.cpp:34
auto is_running(seq_id_t id) -> bool
Checks if the action is running.
Definition seq.cpp:44
void shutdown()
Shuts down the action management system, stopping all actions.
Definition seq.cpp:122
void set_speed_multiplier(seq_id_t id, float speed_multiplier)
Sets the speed multiplier for an action.
Definition seq.cpp:64
auto is_stopping(seq_id_t id) -> bool
Checks if the action is stopping.
Definition seq.cpp:39
auto get_speed_multiplier(seq_id_t id) -> float
Gets the speed multiplier of an action.
Definition seq.cpp:69
auto get_elapsed(seq_id_t id) -> duration_t
Gets the elapsed duration of an action.
Definition seq.cpp:74
void stop_when_finished(seq_id_t id)
Marks the action to stop when it finishes.
Definition seq.cpp:29
auto has_action_with_scope(const std::string &scope_id) -> bool
Checks if there is an action associated with the given scope ID.
Definition seq.cpp:59
auto get_percent(seq_id_t id) -> float
Gets the percentage completion of an action.
Definition seq.cpp:99
void stop(seq_id_t id)
Stops the action associated with the given ID.
Definition seq.cpp:14
std::chrono::nanoseconds duration_t
Represents a duration in nanoseconds.
Definition seq_common.h:41
void pause(const seq_id_t id)
Pauses the action associated with the given ID.
Definition seq.cpp:19