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

Identity-only editor state that never enters the document or its undo history. More...

#include <selection.hpp>

Public Member Functions

std::span< const timeline::ItemId > items () const noexcept
 Returns selected identities in ascending order without duplicates.
std::optional< timeline::ItemId > anchor () const noexcept
 Returns the identity from which range extension begins, when one exists.
bool contains (timeline::ItemId item) const noexcept
 Returns whether item is selected.
bool empty () const noexcept
 Returns whether no identities are selected.
void clear () noexcept
 Clears the selected identities and range anchor.
void replace (std::span< const timeline::ItemId > items)
 Replaces the selection, retaining the first valid input as the range anchor.
void add (timeline::ItemId item)
 Adds one identity while preserving an existing range anchor.
void toggle (timeline::ItemId item)
 Adds an absent identity or removes a selected one.
bool extend_from_anchor (timeline::ItemId item, std::span< const timeline::ItemId > ordered_items)
 Replaces the selection with the inclusive ordered range from the anchor to item.
void prune (const timeline::Project &project)
 Removes identities missing from project or retained only as inactive tombstones.

Detailed Description

Identity-only editor state that never enters the document or its undo history.

Member Function Documentation

◆ add()

void pulp::timeline_editor::Selection::add ( timeline::ItemId item)
inline

Adds one identity while preserving an existing range anchor.

◆ anchor()

std::optional< timeline::ItemId > pulp::timeline_editor::Selection::anchor ( ) const
inlinenoexcept

Returns the identity from which range extension begins, when one exists.

◆ clear()

void pulp::timeline_editor::Selection::clear ( )
inlinenoexcept

Clears the selected identities and range anchor.

◆ contains()

bool pulp::timeline_editor::Selection::contains ( timeline::ItemId item) const
inlinenoexcept

Returns whether item is selected.

◆ empty()

bool pulp::timeline_editor::Selection::empty ( ) const
inlinenoexcept

Returns whether no identities are selected.

◆ extend_from_anchor()

bool pulp::timeline_editor::Selection::extend_from_anchor ( timeline::ItemId item,
std::span< const timeline::ItemId > ordered_items )
inline

Replaces the selection with the inclusive ordered range from the anchor to item.

Returns false when item, or an existing anchor, is absent from ordered_items. With no anchor, a present item becomes the sole selection and establishes one.

◆ items()

std::span< const timeline::ItemId > pulp::timeline_editor::Selection::items ( ) const
inlinenoexcept

Returns selected identities in ascending order without duplicates.

◆ prune()

void pulp::timeline_editor::Selection::prune ( const timeline::Project & project)
inline

Removes identities missing from project or retained only as inactive tombstones.

◆ replace()

void pulp::timeline_editor::Selection::replace ( std::span< const timeline::ItemId > items)
inline

Replaces the selection, retaining the first valid input as the range anchor.

◆ toggle()

void pulp::timeline_editor::Selection::toggle ( timeline::ItemId item)
inline

Adds an absent identity or removes a selected one.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/timeline_editor/include/pulp/timeline_editor/selection.hpp