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

◆ root_audio_buffer() [1/2]

InspectResult MayaFlux::Portal::Forma::Inspector::root_audio_buffer ( Buffers::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 root audio buffers for a token across every channel.

Header shows token and total channel count. Each channel is expanded as a nested root_audio_buffer() result, related for visibility cascade.

Definition at line 149 of file BufferQuery.cpp.

154{
155 const uint32_t ch_count = m_bm.get_num_channels(token);
156
157 const float ind = x_min + static_cast<float>(depth) * k_inspect_indent;
158 const std::string header_label = std::string(Reflect::enum_to_string(token))
159 + " [" + std::to_string(ch_count) + " ch]";
160
161 auto& bm = m_bm;
162 std::vector<EntrySpec> entrys {
163 EntrySpec {
164 .label = "channels",
165 .reader = [&bm, token] { return std::to_string(bm.get_num_channels(token)); },
166 },
167 };
168
169 auto hbuf = make_header_buffer(surface.window());
170 auto rbufs = make_row_buffers(surface.window(), entrys.size());
171 auto group = make_entry_group(entrys, header_label, std::move(hbuf), rbufs,
172 surface, cursor, ind, x_max, row_h, false);
173
174 InspectResult result;
175 result.group = std::move(group);
176
177 for (uint32_t ch = 0; ch < ch_count; ++ch) {
178 auto ch_result = root_audio_buffer(
179 token, ch,
180 surface, cursor,
181 x_min, x_max, row_h, depth + 1);
182 surface.layer().relate(result.group.header.header_id, ch_result.group.header.header_id);
183 result.children.push_back(std::move(ch_result));
184 }
185
186 return result;
187}
uint32_t depth
uint32_t get_num_channels(ProcessingToken token) const
Gets the number of channels for a token (audio-specific)
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
InspectResult 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.
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
constexpr std::string_view enum_to_string(EnumType value) noexcept
Universal enum to string converter using magic_enum (original case)

References MayaFlux::Portal::Forma::InspectResult::children, depth, MayaFlux::Reflect::enum_to_string(), MayaFlux::Buffers::BufferManager::get_num_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_bm, MayaFlux::Portal::Forma::make_entry_group(), make_header_buffer(), make_row_buffers(), MayaFlux::Portal::Forma::Layer::relate(), root_audio_buffer(), and MayaFlux::Portal::Forma::Surface::window().

+ Here is the call graph for this function: