Inspect the full NodeGraphManager state across all active tokens.
266{
269 }
270
272
273 const std::string root_label = "NodeGraphManager ["
274 + std::to_string(tokens.size()) + " token"
275 + (tokens.size() == 1 ? "" : "s") + "]";
276
278 std::vector<ValueSpec> root_values {
279 ValueSpec {
280 .label = "tokens",
281 .reader = [&ngm] { return std::to_string(ngm.get_active_tokens().size()); },
282 },
283 };
284
285 const auto dims =
row_pixel_dims(surface.window(), x_min, x_max, row_h);
287 std::vector<RowBuffer> rbufs;
288 rbufs.reserve(root_values.size());
289 for (const auto& spec : root_values)
291
293 surface, cursor, x_min, x_max, row_h, false);
294
296 result.group = std::move(root_group);
297
298 for (const auto tok : tokens) {
302 if (multichannel)
303 std::ranges::sort(channels);
304
305 std::vector<ValueSpec> tok_values {
306 ValueSpec {
307 .label = "nodes",
308 .reader = [&ngm, tok] { return std::to_string(ngm.get_node_count(tok)); },
309 },
310 ValueSpec {
311 .label = "networks",
312 .reader = [&ngm, tok] { return std::to_string(ngm.get_network_count(tok)); },
313 },
314 };
315
317 auto tok_hbuf =
make_row_buffer(surface.window(), tok_label, tok_dims);
318 std::vector<RowBuffer> tok_rbufs;
319 tok_rbufs.reserve(tok_values.size());
320 for (const auto& spec : tok_values)
321 tok_rbufs.push_back(
make_row_buffer(surface.window(), spec.label, tok_dims));
322
323 auto tok_group =
make_value_group(tok_values, std::move(tok_hbuf), tok_rbufs,
325
326 InspectResult tok_result;
327 tok_result.group = std::move(tok_group);
328 surface.layer().relate(result.group.header.header_id, tok_result.group.header.header_id);
329
330
331 {
333 auto net_hbuf =
make_row_buffer(surface.window(),
"Networks", net_dims);
336
337 InspectResult net_section;
338 net_section.group = std::move(net_group);
339 surface.layer().relate(tok_result.group.header.header_id, net_section.group.header.header_id);
340
341 if (multichannel) {
342 for (const auto ch : channels) {
344 auto ch_hbuf =
make_row_buffer(surface.window(),
"ch " + std::to_string(ch), ch_dims);
347
348 InspectResult ch_result;
349 ch_result.group = std::move(ch_group);
350 surface.layer().relate(net_section.group.header.header_id, ch_result.group.header.header_id);
351
352 for (
const auto& net :
m_ngm.get_networks(tok, ch)) {
353 if (!net)
354 continue;
355 auto nr =
node_network(net, surface, cursor, x_min, x_max, row_h, 4);
356 surface.layer().relate(ch_result.group.header.header_id, nr.group.header.header_id);
357 ch_result.children.push_back(std::move(nr));
358 }
359
360 net_section.children.push_back(std::move(ch_result));
361 }
362 } else {
363 for (
const auto& net :
m_ngm.get_networks(tok, 0)) {
364 if (!net)
365 continue;
366 auto nr =
node_network(net, surface, cursor, x_min, x_max, row_h, 3);
367 surface.layer().relate(net_section.group.header.header_id, nr.group.header.header_id);
368 net_section.children.push_back(std::move(nr));
369 }
370 }
371
372 tok_result.children.push_back(std::move(net_section));
373 }
374
375
376 {
378 auto nodes_hbuf =
make_row_buffer(surface.window(),
"Nodes", nodes_dims);
381
382 InspectResult nodes_section;
383 nodes_section.group = std::move(nodes_group);
384 surface.layer().relate(tok_result.group.header.header_id, nodes_section.group.header.header_id);
385
386 if (multichannel) {
387 for (const auto ch : channels) {
388 auto rn =
root_node(tok, ch, surface, cursor, x_min, x_max, row_h, 3);
389 surface.layer().relate(nodes_section.group.header.header_id, rn.group.header.header_id);
390 nodes_section.children.push_back(std::move(rn));
391 }
392 } else {
393 auto rn =
root_node(tok, 0, surface, cursor, x_min, x_max, row_h, 3);
394 surface.layer().relate(nodes_section.group.header.header_id, rn.group.header.header_id);
395 nodes_section.children.push_back(std::move(rn));
396 }
397
398 tok_result.children.push_back(std::move(nodes_section));
399 }
400
401 result.children.push_back(std::move(tok_result));
402 }
403
404 return result;
405}
std::vector< ProcessingToken > get_active_tokens() const
Gets all currently active processing tokens (domains)
std::vector< unsigned int > get_all_channels(ProcessingToken token) const
Gets all channel indices for a given processing token.
@ AUDIO_RATE
Nodes that process at the audio sample rate.
constexpr std::string_view enum_to_string(EnumType value) noexcept
Universal enum to string converter using magic_enum (original case)