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

#include <ab_compare.hpp>

Public Types

enum class  Slot { A = 0 , B = 1 }

Public Member Functions

 ABCompare (state::StateStore *store)
Slot current () const
 Which slot is currently live (i.e.
void save_to (Slot slot)
 Capture the StateStore's current state into slot.
bool load_from (Slot slot)
 Restore the StateStore from slot.
bool toggle ()
 Toggle between A and B. Fails if the target slot has no snapshot.
void copy (Slot src, Slot dst)
 Overwrite dst with a copy of src's snapshot.
void swap ()
 Swap A and B.
bool has (Slot slot) const
 Does slot currently hold a snapshot?
void clear (Slot slot)
 Drop any saved snapshot from slot.
std::span< const uint8_t > snapshot (Slot slot) const
 Raw snapshot bytes (exposed for serialization of the A/B pair itself — e.g.

Member Enumeration Documentation

◆ Slot

enum class pulp::view::ABCompare::Slot
strong
Enumerator
A 
B 

Constructor & Destructor Documentation

◆ ABCompare()

pulp::view::ABCompare::ABCompare ( state::StateStore * store)
inlineexplicit

Member Function Documentation

◆ clear()

void pulp::view::ABCompare::clear ( Slot slot)
inline

Drop any saved snapshot from slot.

◆ copy()

void pulp::view::ABCompare::copy ( Slot src,
Slot dst )
inline

Overwrite dst with a copy of src's snapshot.

Useful when a user wants "start B from A and tweak".

◆ current()

Slot pulp::view::ABCompare::current ( ) const
inline

Which slot is currently live (i.e.

what the StateStore was last switched to). Defaults to A.

◆ has()

bool pulp::view::ABCompare::has ( Slot slot) const
inline

Does slot currently hold a snapshot?

◆ load_from()

bool pulp::view::ABCompare::load_from ( Slot slot)
inline

Restore the StateStore from slot.

Call once at startup to prime an initial snapshot before any user edits; subsequent load_from calls drive the A/B toggle itself.

◆ save_to()

void pulp::view::ABCompare::save_to ( Slot slot)
inline

Capture the StateStore's current state into slot.

◆ snapshot()

std::span< const uint8_t > pulp::view::ABCompare::snapshot ( Slot slot) const
inline

Raw snapshot bytes (exposed for serialization of the A/B pair itself — e.g.

persisting A/B across session reloads).

◆ swap()

void pulp::view::ABCompare::swap ( )
inline

Swap A and B.

◆ toggle()

bool pulp::view::ABCompare::toggle ( )
inline

Toggle between A and B. Fails if the target slot has no snapshot.


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