49 static constexpr NullFunc no_release =
nullptr;
83 Wiring& on(std::shared_ptr<Core::Window> window,
IO::Keys key,
bool held,
84 std::function<
void()> on_release =
nullptr);
105 std::function<
void(
double,
double)> on_release =
nullptr);
114 std::function<
void(
double,
double)> on_release);
140 std::function<
void(
double,
double)> fn);
147 Wiring& move_to(
const glm::vec3& pos,
double delay_seconds = 0.0);
153 Wiring& position_from(PositionFn fn);
160 Wiring& position_from(std::string fn_name, PositionFn fn);
175 Wiring& use(SoundFactory factory);
176 Wiring& use(GraphicsFactory factory);
177 Wiring& use(CrossFactory factory);
178 Wiring& use(EventFactory factory);
181 Wiring& use(std::string fn_name, SoundFactory factory);
182 Wiring& use(std::string fn_name, GraphicsFactory factory);
183 Wiring& use(std::string fn_name, CrossFactory factory);
184 Wiring& use(std::string fn_name, EventFactory factory);
202 Wiring& bind(std::function<
void()> fn);
210 Wiring& bind(std::function<
void()> attach, std::function<
void()> detach);
213 Wiring& bind(std::string fn_name, std::function<
void()> fn);
216 Wiring& bind(std::string attach_name, std::function<
void()> attach,
217 std::string detach_name, std::function<
void()> detach);
242 , m_entity_id(entity_id)
265 std::optional<std::function<void(
double,
double)>>
on_release;
271 std::function<void(
double,
double)>
fn;
296 using Factory = std::variant<std::monostate, SoundFactory, GraphicsFactory, CrossFactory>;
299 std::string make_name(
const char* prefix)
const;
302 bool m_has_scheduling {};
309 size_t m_times { 1 };
340 [[nodiscard]] uint32_t entity_id()
const {
return m_entity_id; }
343 [[nodiscard]] std::optional<double>
interval()
const {
return m_interval; }
346 [[nodiscard]] std::optional<double>
duration()
const {
return m_duration; }
352 [[nodiscard]]
const std::vector<MoveStep>&
move_steps()
const {
return m_move_steps; }
355 [[nodiscard]]
bool is_scroll()
const {
return std::holds_alternative<ScrollTrigger>(m_trigger); }
370 [[nodiscard]]
bool has_bind()
const {
return m_bind_attach.has_value(); }
379 [[nodiscard]]
const std::string&
factory_name()
const {
return m_factory_name; }
Orchestrates spatial indexing and scheduling for Nexus objects.
std::optional< std::function< void()> > m_bind_detach
bool has_position_fn() const
True if position_from was called.
const Trigger & trigger() const
Active trigger variant set by on.
std::string m_position_fn_name
bool is_scroll() const
True if on_scroll was called.
bool has_bind_detach() const
True if bind(attach, detach) was called.
std::function< Vruta::CrossRoutine()> CrossFactory
std::string m_bind_attach_name
const std::string & position_fn_name() const
Name of the position function, empty if anonymous.
const std::string & bind_attach_name() const
Name of the bind attach function, empty if anonymous or none.
const std::string & factory_name() const
Name of the active factory, empty if anonymous or none.
Wiring(Wiring &&) noexcept=default
const EFactory & event_factory() const
Active event-factory, if use(EventFactory) was called.
std::function< glm::vec3()> PositionFn
std::optional< std::function< void()> > m_bind_attach
const std::vector< MoveStep > & move_steps() const
Choreography steps from move_to calls.
std::optional< double > m_duration
std::optional< EventFactory > EFactory
Wiring & operator=(const Wiring &)=delete
std::function< Vruta::GraphicsRoutine()> GraphicsFactory
std::function< Vruta::Event(Vruta::TaskScheduler &)> EventFactory
const std::string & bind_detach_name() const
Name of the bind detach function, empty if anonymous or none.
std::optional< double > m_interval
const Factory & factory() const
Active factory variant set by use for non-Event factories.
bool has_bind() const
True if any bind overload was called.
std::optional< double > interval() const
Recurring interval in seconds, if every was called.
std::optional< double > duration() const
Active duration in seconds, if for_duration was called.
Wiring(const Wiring &)=delete
std::string m_bind_detach_name
std::vector< MoveStep > m_move_steps
std::string m_factory_name
size_t times_count() const
Repetition count set by times, default 1.
std::optional< PositionFn > m_position_fn
Wiring(Fabric &fabric, uint32_t entity_id)
std::variant< std::monostate, SoundFactory, GraphicsFactory, CrossFactory > Factory
std::variant< std::monostate, KeyTrigger, MouseTrigger, NetworkTrigger, EventTrigger, WindowEventTrigger, ScrollTrigger > Trigger
std::function< Vruta::SoundRoutine()> SoundFactory
Fluent builder that wires an entity into Fabric's scheduling infrastructure.
Coroutine resumed by more than one clock.
Base for event filters used by EventSources to match signals to awaiters.
Abstract base for all awaitable signal sources.
Coroutine type for event-driven suspension.
A C++20 coroutine-based graphics processing task with frame-accurate timing.
Awaitable broadcast message stream for a network endpoint.
A C++20 coroutine-based audio processing task with sample-accurate timing.
Token-based multimodal task scheduling system for unified coroutine processing.
Awaitable stream of GLFW window input events.
MouseButtons
Enumeration for mouse buttons.
void on_scroll(const std::shared_ptr< Core::Window > &window, std::function< void(double, double)> callback, std::string name)
Schedule a mouse scroll handler.
Vruta::EventFilter filter
Vruta::EventSource * source
std::shared_ptr< Core::Window > window
std::optional< std::function< void()> > on_release
std::optional< std::function< void(double, double)> > on_release
std::shared_ptr< Core::Window > window
Vruta::NetworkSource * source
Vruta::WindowEventFilter filter
Filter criteria for GLFW window input events.