72 bool& truncated, std::function<
bool()> continue_emission = {},
73 bool* interrupted =
nullptr);
79 std::size_t
play_bounded(std::size_t maximum_events,
bool& truncated,
80 std::function<
bool()> continue_emission = {},
81 bool* interrupted =
nullptr);
103 mutable std::mutex mtx_;
104 std::vector<view::motion::SampleEvent> events_;
106 std::uint64_t playhead_frame_ = 0;
107 std::uint64_t max_frame_ = 0;
108 bool loaded_ =
false;
109 bool playing_ =
false;
115 std::vector<SinkSlot> sinks_;
116 int next_sink_id_ = 1;
119 InspectorMessage handle_load_fixture(
const InspectorMessage& req);
120 InspectorMessage handle_scrub_to(
const InspectorMessage& req);
121 InspectorMessage handle_play(
const InspectorMessage& req);
122 InspectorMessage handle_pause(
const InspectorMessage& req);
127 static std::size_t dispatch_snapshot(
128 const std::vector<view::motion::SampleEvent>&
events,
129 const std::vector<SinkSlot>& sinks,
131 const std::function<
bool()>& continue_emission = {},
bool* interrupted =
nullptr);
std::size_t play_bounded(std::size_t maximum_events, bool &truncated, std::function< bool()> continue_emission={}, bool *interrupted=nullptr)
MotionScrubber(const MotionScrubber &)=delete
InspectorMessage handle(const InspectorMessage &req)
Handle a Motion.
std::size_t play()
Set playing flag, advance to the last loaded frame, emit everything.
std::size_t event_count() const
std::size_t scrub_to(std::uint64_t frame)
Move the playhead to the given frame and re-emit the prefix of events with frame <= playhead.
std::size_t scrub_to_bounded(std::uint64_t frame, std::size_t maximum_events, bool &truncated, std::function< bool()> continue_emission={}, bool *interrupted=nullptr)
Canonical control variant: emits at most maximum_events from the selected prefix and reports whether ...
MotionScrubber(InspectorEventSink event_sink={})
Construct with an optional event delivery callback.
int add_sink(view::motion::Sink sink)
Install a sink that receives re-emitted events.
bool load_fixture(const std::string &path)
Load a fixture file.
std::uint64_t playhead_frame() const
MotionScrubber & operator=(const MotionScrubber &)=delete
static bool owns_method(const std::string &method)
True when at least one of the scrubber methods is the natural target for req.method.
view::motion::FixtureHeader header() const
std::uint64_t max_frame() const
void pause()
Clear the playing flag. No event emission. Playhead unchanged.
Agent-first motion observability: sample view geometry, scroll state, and arbitrary scalar values at ...
@ path
Definition scene_node.hpp:93
Definition child_process_manager.hpp:18
Definition agent_context.hpp:7
std::function< void(const InspectorMessage &)> InspectorEventSink
Definition inspector_delivery.hpp:30
std::function< void(const SampleEvent &)> Sink
Definition motion.hpp:389
A single inspector protocol message (request, response, or event).
Definition protocol.hpp:18