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

◆ root_node() [1/2]

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

Inspect all RootNodes for a token.

For AUDIO_RATE: header shows token and channel count, each channel expanded as a nested root_node(token, channel) result. For all other tokens: delegates directly to root_node(token, 0).

Definition at line 170 of file NodeQuery.cpp.

175{
177 return root_node(token, 0, surface, cursor, x_min, x_max, row_h, depth);
178
179 auto channels = m_ngm.get_all_channels(token);
180 std::ranges::sort(channels);
181
182 const float ind = x_min + static_cast<float>(depth) * k_inspect_indent;
183 const std::string header_label = "root [" + std::to_string(channels.size()) + " ch]";
184
185 auto& ngm = m_ngm;
186 std::vector<EntrySpec> entrys {
187 EntrySpec {
188 .label = "channels",
189 .reader = [&ngm, token] { return std::to_string(ngm.get_all_channels(token).size()); },
190 },
191 };
192
193 auto hbuf = make_header_buffer(surface.window());
194 auto rbufs = make_row_buffers(surface.window(), entrys.size());
195 auto group = make_entry_group(entrys, header_label, std::move(hbuf), rbufs,
196 surface, cursor, ind, x_max, row_h, false);
197
198 InspectResult result;
199 result.group = std::move(group);
200
201 for (const auto ch : channels) {
202 auto ch_result = root_node(token, ch, surface, cursor, x_min, x_max, row_h, depth + 1);
203 surface.layer().relate(result.group.header.header_id, ch_result.group.header.header_id);
204 result.children.push_back(std::move(ch_result));
205 }
206 return result;
207}
uint32_t channels
uint32_t depth
std::vector< unsigned int > get_all_channels(ProcessingToken token) const
Gets all channel indices for a given processing token.
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 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.
@ 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, channels, MayaFlux::Portal::Forma::InspectResult::children, depth, MayaFlux::Nodes::NodeGraphManager::get_all_channels(), 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(), MayaFlux::Portal::Forma::Layer::relate(), root_node(), and MayaFlux::Portal::Forma::Surface::window().

+ Here is the call graph for this function: