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

◆ root_audio_buffer() [2/2]

InspectResult MayaFlux::Portal::Forma::Inspector::root_audio_buffer ( Buffers::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 the root audio buffer for a specific token and channel.

Header shows channel index and token. Rows show sample count and child count. The root buffer itself is expanded via buffer(), then each child buffer is expanded via buffer() in order.

Definition at line 94 of file BufferQuery.cpp.

99{
100 auto root = m_bm.get_root_audio_buffer(token, channel);
101 if (!root)
102 return {};
103
104 const auto children = root->get_child_buffers();
105
106 const float ind = x_min + static_cast<float>(depth) * k_inspect_indent;
107 const std::string header_label = "ch " + std::to_string(channel);
108
109 std::vector<EntrySpec> entrys {
110 EntrySpec {
111 .label = "samples",
112 .reader = [root] { return std::to_string(root->get_num_samples()); },
113 },
114 EntrySpec {
115 .label = "children",
116 .reader = [root] { return std::to_string(root->get_num_children()); },
117 },
118 };
119
120 auto hbuf = make_header_buffer(surface.window());
121 auto rbufs = make_row_buffers(surface.window(), entrys.size());
122 auto group = make_entry_group(entrys, header_label, std::move(hbuf), rbufs,
123 surface, cursor, ind, x_max, row_h, false);
124
125 InspectResult result;
126 result.group = std::move(group);
127
128 auto root_result = buffer(
129 root, surface, cursor,
130 x_min, x_max, row_h, depth + 1);
131 surface.layer().relate(result.group.header.header_id, root_result.group.header.header_id);
132 result.children.push_back(std::move(root_result));
133
134 for (const auto& child : children) {
135 auto child_result = buffer(
136 child, surface, cursor,
137 x_min, x_max, row_h, depth + 2);
138 surface.layer().relate(result.group.header.header_id, child_result.group.header.header_id);
139 result.children.push_back(std::move(child_result));
140 }
141
142 return result;
143}
std::shared_ptr< NetworkGeometryBuffer > buffer
uint32_t depth
std::shared_ptr< RootAudioBuffer > get_root_audio_buffer(ProcessingToken token, uint32_t channel=0)
Gets a root buffer for a specific token and channel (audio-specific due to channels)
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
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
Buffers::BufferManager & m_bm
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 buffer, MayaFlux::Portal::Forma::InspectResult::children, depth, MayaFlux::Buffers::BufferManager::get_root_audio_buffer(), 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_bm, MayaFlux::Portal::Forma::make_entry_group(), make_header_buffer(), make_row_buffers(), MayaFlux::Portal::Forma::Layer::relate(), and MayaFlux::Portal::Forma::Surface::window().

Referenced by buffer_manager(), and root_audio_buffer().

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