40 float x_min,
float x_max,
float row_h,
int depth)
44 const std::string header_label = std::string(role_label(tree.
role))
47 auto node_ref = tree.
node;
48 std::vector<EntrySpec> entrys {
51 .reader = [node_ref] {
return std::to_string(node_ref->get_last_output()); },
59 surface, cursor, ind, x_max, row_h,
false);
62 result.
group = std::move(group);
66 child, surface, cursor,
67 x_min, x_max, row_h,
depth + 1);
70 child_result.group.header.header_id);
71 result.
children.push_back(std::move(child_result));
82 const std::shared_ptr<Nodes::Node>& n,
85 float x_min,
float x_max,
float row_h,
int depth)
91 std::vector<EntrySpec> entrys {
94 .reader = [node_ref] {
return std::to_string(node_ref->get_last_output()); },
102 surface, cursor, ind, x_max, row_h,
false);
105 result.
group = std::move(group);
107 for (
const auto& tree : n->get_modulator_tree()) {
109 tree, surface, cursor,
110 x_min, x_max, row_h,
depth + 1);
113 child.group.header.header_id);
114 result.
children.push_back(std::move(child));
128 float x_min,
float x_max,
float row_h,
int depth)
134 ?
"root [ch " + std::to_string(channel) +
"]"
137 std::vector<EntrySpec> entrys {
140 .reader = [&root] {
return std::to_string(root.get_node_size()); },
148 surface, cursor, ind, x_max, row_h,
false);
151 result.
group = std::move(group);
153 for (
const auto& n : root.nodes()) {
156 auto node_result =
node(
158 x_min, x_max, row_h,
depth + 1);
160 result.
children.push_back(std::move(node_result));
174 float x_min,
float x_max,
float row_h,
int depth)
177 return root_node(token, 0, surface, cursor, x_min, x_max, row_h,
depth);
183 const std::string header_label =
"root [" + std::to_string(
channels.size()) +
" ch]";
186 std::vector<EntrySpec> entrys {
189 .reader = [&ngm, token] {
return std::to_string(ngm.get_all_channels(token).size()); },
196 surface, cursor, ind, x_max, row_h,
false);
199 result.
group = std::move(group);
202 auto ch_result =
root_node(token, ch, surface, cursor, x_min, x_max, row_h,
depth + 1);
204 result.
children.push_back(std::move(ch_result));
213 const std::shared_ptr<Nodes::Network::NodeNetwork>& net,
216 float x_min,
float x_max,
float row_h,
int depth)
220 const std::string header_label
226 std::vector<EntrySpec> entrys {
229 .reader = [net_ref] {
return std::to_string(net_ref->get_node_count()); },
233 .reader = [net_ref] {
return net_ref->is_enabled() ?
"true" :
"false"; },
237 .reader = [net_ref] {
238 const auto ch = net_ref->get_registered_channels();
240 for (
size_t i = 0; i < ch.size(); ++i) {
243 s += std::to_string(ch[i]);
245 return s.empty() ?
"-" : s;
254 surface, cursor, ind, x_max, row_h,
false);
257 result.
group = std::move(group);
268 float x_min,
float x_max,
float row_h)
276 const std::string root_label =
"NodeGraphManager ["
277 + std::to_string(tokens.size()) +
" token"
278 + (tokens.size() == 1 ?
"" :
"s") +
"]";
281 std::vector<EntrySpec> root_entrys {
284 .reader = [&ngm] {
return std::to_string(ngm.get_active_tokens().size()); },
291 auto root_group =
make_entry_group(root_entrys, root_label, std::move(hbuf), rbufs,
292 surface, cursor, x_min, x_max, row_h,
false);
295 result.
group = std::move(root_group);
297 for (
const auto tok : tokens) {
304 std::vector<EntrySpec> tok_entrys {
307 .reader = [&ngm, tok] {
return std::to_string(ngm.get_node_count(tok)); },
311 .reader = [&ngm, tok] {
return std::to_string(ngm.get_network_count(tok)); },
318 auto tok_group =
make_entry_group(tok_entrys, tok_label, std::move(tok_hbuf), tok_rbufs,
322 tok_result.
group = std::move(tok_group);
332 net_section.
group = std::move(net_group);
338 auto ch_group =
make_entry_group({},
"ch " + std::to_string(ch), std::move(ch_hbuf), {},
342 ch_result.
group = std::move(ch_group);
343 surface.
layer().
relate(net_section.group.header.header_id, ch_result.group.header.header_id);
348 auto nr =
node_network(net, surface, cursor, x_min, x_max, row_h, 4);
349 surface.
layer().
relate(ch_result.group.header.header_id, nr.group.header.header_id);
350 ch_result.children.push_back(std::move(nr));
353 net_section.children.push_back(std::move(ch_result));
359 auto nr =
node_network(net, surface, cursor, x_min, x_max, row_h, 3);
360 surface.
layer().
relate(net_section.group.header.header_id, nr.group.header.header_id);
361 net_section.children.push_back(std::move(nr));
365 tok_result.
children.push_back(std::move(net_section));
375 nodes_section.
group = std::move(nodes_group);
380 auto rn =
root_node(tok, ch, surface, cursor, x_min, x_max, row_h, 3);
381 surface.
layer().
relate(nodes_section.group.header.header_id, rn.group.header.header_id);
382 nodes_section.children.push_back(std::move(rn));
385 auto rn =
root_node(tok, 0, surface, cursor, x_min, x_max, row_h, 3);
386 surface.
layer().
relate(nodes_section.group.header.header_id, rn.group.header.header_id);
387 nodes_section.children.push_back(std::move(rn));
390 tok_result.
children.push_back(std::move(nodes_section));
393 result.
children.push_back(std::move(tok_result));
RootNode & get_root_node(ProcessingToken token, unsigned int channel)
Gets or creates the root node for a specific token and channel.
std::vector< ProcessingToken > get_active_tokens() const
Gets all currently active processing tokens (domains)
std::vector< std::shared_ptr< Network::NodeNetwork > > get_networks(ProcessingToken token, uint32_t channel=0) const
Get all networks for a specific token.
std::vector< unsigned int > get_all_channels(ProcessingToken token) const
Gets all channel indices for a given processing token.
ProcessingToken
Enumerates the different processing domains for nodes.
@ AUDIO_RATE
Nodes that process at the audio sample rate.
ModulatorRole
Describes the role a modulator node plays relative to its owner.
constexpr std::string_view enum_to_string(EnumType value) noexcept
Universal enum to string converter using magic_enum (original case)
std::string short_dynamic_type_name(const T &obj) noexcept
Returns the unqualified dynamic type name of obj.
std::vector< ModulatorTree > modulators
std::shared_ptr< Node > node
Recursive tree node describing a modulator and all of its own modulators.
A single entry to display in a EntryGroup body row.