Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::playback::TransportPlayhead Struct Reference

Where the transport is, published for a reader that is not the audio thread. More...

#include <transport.hpp>

Public Member Functions

constexpr bool operator== (const TransportPlayhead &) const =default

Public Attributes

std::uint64_t sequence = 0
 Monotonic per publish.
std::uint64_t playback_epoch = 0
 Identity of the continuous playback interval this reading belongs to.
timebase::TickPosition position {}
 Position of the FIRST frame of the published block.
LoopRegion loop {}
double tempo_bpm = 120.0
bool is_playing = false
 True whenever the position advances on its own.
bool scrubbing = false

Detailed Description

Where the transport is, published for a reader that is not the audio thread.

This is the counterpart to TransportSnapshot, and the difference is the lifetime of what it carries. A snapshot borrows const CompiledTempoMap* from the compiled program, which is correct for a block renderer that consumes it inside the callback that produced it, and unsafe for a view that keeps a copy across frames while the engine may adopt a different program underneath. Every field here is a value, so a retained reading goes stale, never invalid.

The vocabulary is the transport's own. Projecting a reading into the UI vocabulary a timeline editor speaks is the job of whoever implements that seam, because playback's dependency floor excludes the editor rung.

Member Function Documentation

◆ operator==()

bool pulp::playback::TransportPlayhead::operator== ( const TransportPlayhead & ) const
constexprdefault

Member Data Documentation

◆ is_playing

bool pulp::playback::TransportPlayhead::is_playing = false

True whenever the position advances on its own.

Mirrors TransportSnapshot::is_playing, so it is also true while scrubbing and a reader asking only "does the playhead move" needs no scrub branch.

◆ loop

LoopRegion pulp::playback::TransportPlayhead::loop {}

◆ playback_epoch

std::uint64_t pulp::playback::TransportPlayhead::playback_epoch = 0

Identity of the continuous playback interval this reading belongs to.

A change means continuity broke, so a reader interpolating between two readings must not interpolate across one.

◆ position

timebase::TickPosition pulp::playback::TransportPlayhead::position {}

Position of the FIRST frame of the published block.

That frame has not left the device yet, so it is the least-ahead-of-audible position the transport can state; publishing the block's end would put every reading one buffer into the future.

◆ scrubbing

bool pulp::playback::TransportPlayhead::scrubbing = false

◆ sequence

std::uint64_t pulp::playback::TransportPlayhead::sequence = 0

Monotonic per publish.

Two readings with the same value are the same reading, which is how a reader skips redundant work. Zero means nothing has been published yet. reset() deliberately does not restart it: a restarted counter would make a new reading indistinguishable from one a reader already acted on.

◆ tempo_bpm

double pulp::playback::TransportPlayhead::tempo_bpm = 120.0

The documentation for this struct was generated from the following file:
  • /home/runner/work/pulp/pulp/core/playback/include/pulp/playback/transport.hpp