MayaFlux 0.4.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 152 of file BufferQuery.cpp.

157{
158 const uint32_t ch_count = m_bm.get_num_channels(token);
159
160 const float ind = x_min + static_cast<float>(depth) * k_inspect_indent;
161 const std::string header_label = std::string(Reflect::enum_to_string(token))
162 + " [" + std::to_string(ch_count) + " ch]";
163
164 auto& bm = m_bm;
165 std::vector<ValueSpec> values {
166 ValueSpec {
167 .label = "channels",
168 .reader = [&bm, token] { return std::to_string(bm.get_num_channels(token)); },
169 },
170 };
171
172 const auto dims = row_pixel_dims(surface.window(), ind, x_max, row_h);
173 auto hbuf = make_row_buffer(surface.window(), header_label, dims);
174 std::vector<RowBuffer> rbufs;
175 rbufs.reserve(values.size());
176 for (const auto& spec : values)
177 rbufs.push_back(make_row_buffer(surface.window(), spec.label, dims));
178 auto group = make_value_group(values, std::move(hbuf), rbufs,
179 surface, cursor, ind, x_max, row_h, false);
180
181 InspectResult result;
182 result.group = std::move(group);
183
184 for (uint32_t ch = 0; ch < ch_count; ++ch) {
185 auto ch_result = root_audio_buffer(
186 token, ch,
187 surface, cursor,
188 x_min, x_max, row_h, depth + 1);
189 surface.layer().relate(result.group.header.header_id, ch_result.group.header.header_id);
190 result.children.push_back(std::move(ch_result));
191 }
192
193 return result;
194}
uint32_t get_num_channels(ProcessingToken token) const
Gets the number of channels for a token (audio-specific)
RowBuffer make_row_buffer(const std::shared_ptr< Core::Window > &window, std::string_view text, glm::uvec2 pixel_dims) const
Definition Inspector.cpp:13
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
ValueGroup make_value_group(std::span< const ValueSpec > values, RowBuffer header_buf, std::span< const RowBuffer > 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 value rows under it.
constexpr float k_inspect_indent
glm::uvec2 row_pixel_dims(const std::shared_ptr< Core::Window > &window, float x_min, float x_max, float row_h)
Convert an NDC row rect into integer pixel dimensions.
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, MayaFlux::Reflect::enum_to_string(), MayaFlux::Buffers::BufferManager::get_num_channels(), MayaFlux::Portal::Forma::InspectResult::group, MayaFlux::Portal::Forma::ValueGroup::header, MayaFlux::Portal::Forma::Collapsible::header_id, MayaFlux::Portal::Forma::k_inspect_indent, MayaFlux::Portal::Forma::ValueSpec::label, MayaFlux::Portal::Forma::Surface::layer(), m_bm, make_row_buffer(), MayaFlux::Portal::Forma::make_value_group(), MayaFlux::Portal::Forma::Layer::relate(), root_audio_buffer(), MayaFlux::Portal::Forma::row_pixel_dims(), and MayaFlux::Portal::Forma::Surface::window().

+ Here is the call graph for this function: