|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
Owns one described struct of Slot members for a host such as a network, an operator or an input node. More...
#include <ControlValueStore.hpp>
Classes | |
| struct | Entry |
Public Member Functions | |
| ControlValueStore ()=default | |
| ControlValueStore (const ControlValueStore &)=delete | |
| ControlValueStore (ControlValueStore &&)=delete | |
| template<typename C> | |
| C & | declare () |
| Creates the struct and returns it, for the host to hold by reference. | |
| template<typename C> | |
| void | merge (const C &incoming) |
Applies every member of incoming that holds a value. | |
| ControlValueStore & | operator= (const ControlValueStore &)=delete |
| ControlValueStore & | operator= (ControlValueStore &&)=delete |
| void | refresh (double *scale=nullptr) |
| Reads sources into their slots. | |
| bool | set_named (std::string_view name, double value) |
Sets the member called name to the number value. | |
| bool | settle_named (std::string_view name) |
Drops the pending value of the member called name. | |
| template<typename C> | |
| C | snapshot (const double *scale=nullptr) const |
| A copy of the struct. | |
| ~ControlValueStore ()=default | |
Static Public Member Functions | |
| template<typename C> requires NumericControlSlot<Slot> | |
| static std::optional< double > | read_named (const C &controls, std::string_view name) |
The number held by the member called name, or nullopt for none or a vector. | |
Private Member Functions | |
| template<typename Member, typename C> | |
| void | add_member (const Member &member, C &owner, const std::string &prefix) |
| template<typename C> | |
| void | add_members (C &owner, const std::string &prefix) |
Static Private Member Functions | |
| template<typename Member, typename C> | |
| static void | merge_member (const Member &member, C &live, const C &incoming) |
| template<typename C> | |
| static void | merge_members (C &live, const C &incoming) |
| template<typename Member, typename C> | |
| static void | observe_scale (const Member &member, C ¤t, double scale) |
| template<typename Member, typename C> | |
| static void | read_member (const Member &member, const C &owner, std::string_view name, std::optional< double > &found) |
| template<typename C> | |
| static const void * | tag () noexcept |
Private Attributes | |
| Slot * | m_scale = nullptr |
| std::vector< Entry > | m_slots |
| std::shared_ptr< void > | m_storage |
| const void * | m_tag = nullptr |
Owns one described struct of Slot members for a host such as a network, an operator or an input node.
A host holds one as a member and forwards to it. It is not a base class. declare() creates the struct and keeps it for the host's lifetime, merge() applies the members an incoming struct holds, snapshot() copies the struct for get(), and refresh() reads sources once per block. A member named scale is mirrored to a value the host passes in, and a host with no scale passes nothing. Every member is a Slot or a described struct of the same, nested to any depth.
A member is also reachable by name through set_named() and read_named(), which back an operator's string based set_parameter and query_state. A member of a nested struct is named by its path joined with dots, such as left.deadzone. Only a top level member named scale is mirrored. Named number access and the scale mirror need a NumericControlSlot.
| Slot | A ControlSlot, the one slot type of every member. |
Definition at line 60 of file ControlValueStore.hpp.