MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ root_node() [2/2]

InspectResult MayaFlux::Portal::Forma::Inspector::root_node ( Nodes::ProcessingToken  token,
uint32_t  channel,
Surface &  surface,
LayoutCursor &  cursor,
float  x_min = -0.95F,
float  x_max = 0.95F,
float  row_h = 0.05F,
int  depth = 0 
)

Inspect a single RootNode for a specific token and channel.

Header is "root [ch N]" for AUDIO_RATE or "root" for all other tokens. Body row exposes live node count from RootNode::get_node_size(). Each registered node is expanded via node() as a child. Networks for the token/channel are appended after the node children.

Definition at line 124 of file NodeQuery.cpp.

129{
130 auto& root = m_ngm.get_root_node(token, channel);
131
132 const float ind = x_min + static_cast<float>(depth) * k_inspect_indent;
133 const std::string header_label = token == Nodes::ProcessingToken::AUDIO_RATE
134 ? "root [ch " + std::to_string(channel) + "]"
135 : "root";
136
137 std::vector<EntrySpec> entrys {
138 EntrySpec {
139 .label = "nodes",
140 .reader = [&root] { return std::to_string(root.get_node_size()); },
141 },
142 };
143
144 auto hbuf = make_header_buffer(surface.window());
145 auto rbufs = make_row_buffers(surface.window(), entrys.size());
146
147 auto group = make_entry_group(entrys, header_label, std::move(hbuf), rbufs,
148 surface, cursor, ind, x_max, row_h, false);
149
150 InspectResult result;
151 result.group = std::move(group);
152
153 for (const auto& n : root.nodes()) {
154 if (!n)
155 continue;
156 auto node_result = node(
157 n, surface, cursor,
158 x_min, x_max, row_h, depth + 1);
159 surface.layer().relate(result.group.header.header_id, node_result.group.header.header_id);
160 result.children.push_back(std::move(node_result));
161 }
162
163 return result;
164}
uint32_t depth
RootNode & get_root_node(ProcessingToken token, unsigned int channel)
Gets or creates the root node for a specific token and channel.
std::shared_ptr< Buffers::FormaBuffer > make_header_buffer(const std::shared_ptr< Core::Window > &window) const
A "text"-slotted buffer, registered with the BufferManager.
Definition Inspector.cpp:11
Nodes::NodeGraphManager & m_ngm
std::vector< EntryBuffer > make_row_buffers(const std::shared_ptr< Core::Window > &window, size_t count) const
count row targets, slices of one "text"-slotted buffer, for make_entry_group's rows.
Definition Inspector.cpp:24
InspectResult node(const std::shared_ptr< Nodes::Node > &n, Surface &surface, LayoutCursor &cursor, float x_min=-0.95F, float x_max=0.95F, float row_h=0.05F, int depth=0)
Inspect a single Node and its full modulator tree.
Definition NodeQuery.cpp:81
@ AUDIO_RATE
Nodes that process at the audio sample rate.
EntryGroup make_entry_group(std::span< const EntrySpec > entrys, std::string_view header_label, FormaTarget header_buf, std::span< const EntryBuffer > row_bufs, Surface &surface, LayoutCursor &cursor, float x_min, float x_max, float row_h, bool initially_open)
Construct a collapsible header followed by N entry rows under it.
Definition Entry.cpp:104
constexpr float k_inspect_indent

References MayaFlux::Nodes::AUDIO_RATE, MayaFlux::Portal::Forma::InspectResult::children, depth, MayaFlux::Nodes::NodeGraphManager::get_root_node(), MayaFlux::Portal::Forma::InspectResult::group, MayaFlux::Portal::Forma::EntryGroup::header, MayaFlux::Portal::Forma::Collapsible::header_id, MayaFlux::Portal::Forma::k_inspect_indent, MayaFlux::Portal::Forma::EntrySpec::label, MayaFlux::Portal::Forma::Surface::layer(), m_ngm, MayaFlux::Portal::Forma::make_entry_group(), make_header_buffer(), make_row_buffers(), node(), MayaFlux::Portal::Forma::Layer::relate(), and MayaFlux::Portal::Forma::Surface::window().

Referenced by node_graph_manager(), and root_node().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: