Contents

class

SushiDSP::ParameterTable

template <typename Node, std::size_t kCount>

A node's whole parameter surface, in index order.

Declared in
include/SushiDSP/core/ParameterTable.hpp

The order is a contract: a host addresses parameters by index and a saved preset reads them back by index, so rows are appended, never reordered or removed. Holding the descriptor and the two accessors in one row is what stops the three from drifting apart.

Public member functions

explicit ParameterTable(const std::array< ParameterBinding< Node >, kCount > &rows)

Parameters

rows

The node's parameters, in the order a host addresses them.

void write(Node &node, const char *id, float value) const

Writes a parameter found by its id.

Control thread only: the lookup compares strings.

Parameters

node

The node to write to.

id

The parameter's id; an unrecognised id is a no-op.

value

The value to write.

void write(Node &node, std::uint16_t index, float value) const

Writes a parameter by index.

Audio-thread safe: an index is a subscript.

Parameters

node

The node to write to.

index

Index into the table; out of range is a no-op.

value

The value to write.

float read(const Node &node, const char *id) const

Reads a parameter found by its id.

Control thread only.

Parameters

node

The node to read from.

id

The parameter's id.

Returns

What the node holds, or 0 for an unrecognised id.

const ParameterDescriptor * descriptors() const noexcept

The descriptor rows, contiguous, for a NodeDescriptor to point at.

Returns

The first of count() descriptors.

std::uint16_t count() const noexcept

How many parameters the table holds.

Returns

The row count, which is also the count a NodeDescriptor declares.