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

Projects a visible musical-time range onto a horizontal pixel span. More...

#include <viewport_projection.hpp>

Public Member Functions

float x_at (timebase::TickPosition tick) const noexcept
timebase::TickPosition tick_at (float x) const noexcept
constexpr timebase::TickPosition visible_start () const noexcept
constexpr timebase::TickDuration visible_duration () const noexcept
constexpr timebase::TickPosition visible_end () const noexcept
constexpr PixelSpan pixels () const noexcept

Static Public Member Functions

static runtime::Result< TickProjection, ViewportProjectionError > create (timebase::TickPosition visible_start, timebase::TickDuration visible_duration, PixelSpan pixels) noexcept

Detailed Description

Projects a visible musical-time range onto a horizontal pixel span.

Forward projection is intentionally not clipped: renderers need offscreen points to preserve the slope of lines crossing a viewport edge. The inverse is a pointer lookup and clamps to the visible range before rounding to the nearest canonical tick.

Member Function Documentation

◆ create()

runtime::Result< TickProjection, ViewportProjectionError > pulp::timeline_editor::TickProjection::create ( timebase::TickPosition visible_start,
timebase::TickDuration visible_duration,
PixelSpan pixels )
staticnoexcept

◆ pixels()

PixelSpan pulp::timeline_editor::TickProjection::pixels ( ) const
inlinenodiscardconstexprnoexcept

◆ tick_at()

timebase::TickPosition pulp::timeline_editor::TickProjection::tick_at ( float x) const
nodiscardnoexcept

◆ visible_duration()

timebase::TickDuration pulp::timeline_editor::TickProjection::visible_duration ( ) const
inlinenodiscardconstexprnoexcept

◆ visible_end()

timebase::TickPosition pulp::timeline_editor::TickProjection::visible_end ( ) const
inlinenodiscardconstexprnoexcept

◆ visible_start()

timebase::TickPosition pulp::timeline_editor::TickProjection::visible_start ( ) const
inlinenodiscardconstexprnoexcept

◆ x_at()

float pulp::timeline_editor::TickProjection::x_at ( timebase::TickPosition tick) const
nodiscardnoexcept

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