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

#include <motion_scrubber.hpp>

Public Member Functions

 MotionScrubber (InspectorEventSink event_sink={})
 Construct with an optional event delivery callback.
 ~MotionScrubber ()
 MotionScrubber (const MotionScrubber &)=delete
MotionScrubber & operator= (const MotionScrubber &)=delete
InspectorMessage handle (const InspectorMessage &req)
 Handle a Motion.
bool load_fixture (const std::string &path)
 Load a fixture file.
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 more matching events existed.
std::size_t play ()
 Set playing flag, advance to the last loaded frame, emit everything.
std::size_t play_bounded (std::size_t maximum_events, bool &truncated, std::function< bool()> continue_emission={}, bool *interrupted=nullptr)
void pause ()
 Clear the playing flag. No event emission. Playhead unchanged.
int add_sink (view::motion::Sink sink)
 Install a sink that receives re-emitted events.
void remove_sink (int id)
bool loaded () const
bool playing () const
std::uint64_t playhead_frame () const
std::size_t event_count () const
std::uint64_t max_frame () const
view::motion::FixtureHeader header () const

Static Public Member Functions

static bool owns_method (const std::string &method)
 True when at least one of the scrubber methods is the natural target for req.method.

Constructor & Destructor Documentation

◆ MotionScrubber() [1/2]

pulp::inspect::MotionScrubber::MotionScrubber ( InspectorEventSink event_sink = {})
explicit

Construct with an optional event delivery callback.

When present, re-emitted events use the same Motion.start / .sample / .end wire shape as MotionInspector. Events always flow to sinks installed via add_sink.

◆ ~MotionScrubber()

pulp::inspect::MotionScrubber::~MotionScrubber ( )

◆ MotionScrubber() [2/2]

pulp::inspect::MotionScrubber::MotionScrubber ( const MotionScrubber & )
delete

Member Function Documentation

◆ add_sink()

int pulp::inspect::MotionScrubber::add_sink ( view::motion::Sink sink)

Install a sink that receives re-emitted events.

Returns a non-zero id usable with remove_sink.

◆ event_count()

std::size_t pulp::inspect::MotionScrubber::event_count ( ) const

◆ handle()

InspectorMessage pulp::inspect::MotionScrubber::handle ( const InspectorMessage & req)

Handle a Motion.

  • scrubber request. Returns response message. Caller (DomainHandler) decides routing — this method assumes the request is one of the scrubber methods.

◆ header()

view::motion::FixtureHeader pulp::inspect::MotionScrubber::header ( ) const

◆ load_fixture()

bool pulp::inspect::MotionScrubber::load_fixture ( const std::string & path)

Load a fixture file.

Returns true on success (any event count is acceptable; an empty fixture is loaded as zero events). Resets the playhead to 0 and clears the previously-loaded events.

◆ loaded()

bool pulp::inspect::MotionScrubber::loaded ( ) const

◆ max_frame()

std::uint64_t pulp::inspect::MotionScrubber::max_frame ( ) const

◆ operator=()

MotionScrubber & pulp::inspect::MotionScrubber::operator= ( const MotionScrubber & )
delete

◆ owns_method()

bool pulp::inspect::MotionScrubber::owns_method ( const std::string & method)
static

True when at least one of the scrubber methods is the natural target for req.method.

DomainHandler uses this to decide whether to route to MotionScrubber vs MotionInspector.

◆ pause()

void pulp::inspect::MotionScrubber::pause ( )

Clear the playing flag. No event emission. Playhead unchanged.

◆ play()

std::size_t pulp::inspect::MotionScrubber::play ( )

Set playing flag, advance to the last loaded frame, emit everything.

Passive: no real-time pacing.

◆ play_bounded()

std::size_t pulp::inspect::MotionScrubber::play_bounded ( std::size_t maximum_events,
bool & truncated,
std::function< bool()> continue_emission = {},
bool * interrupted = nullptr )

◆ playhead_frame()

std::uint64_t pulp::inspect::MotionScrubber::playhead_frame ( ) const

◆ playing()

bool pulp::inspect::MotionScrubber::playing ( ) const

◆ remove_sink()

void pulp::inspect::MotionScrubber::remove_sink ( int id)

◆ scrub_to()

std::size_t pulp::inspect::MotionScrubber::scrub_to ( std::uint64_t frame)

Move the playhead to the given frame and re-emit the prefix of events with frame <= playhead.

Returns the number of events emitted (zero for an unloaded scrubber). Backwards scrubs are supported — each call re-emits from the start.

◆ scrub_to_bounded()

std::size_t pulp::inspect::MotionScrubber::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 more matching events existed.


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