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

◆ update_routing_states_for_cycle()

void MayaFlux::Buffers::BufferSupplyMixing::update_routing_states_for_cycle ( ProcessingToken  token)

Updates routing states for all buffers undergoing transitions.

Parameters
tokenProcessing domain to update

Should be called once per processing cycle to advance routing fade states.

Definition at line 235 of file BufferSupplyMixing.cpp.

236{
237 if (!m_unit_manager.has_audio_unit(token)) {
238 return;
239 }
240
241 auto& unit = m_unit_manager.get_audio_unit_mutable(token);
242
243 for (uint32_t channel = 0; channel < unit.channel_count; ++channel) {
244 auto root_buffer = unit.get_buffer(channel);
245
246 for (auto& child : root_buffer->get_child_buffers()) {
247 if (!child->needs_routing()) {
248 continue;
249 }
250
251 auto& state = child->get_routing_state();
252
253 if (state.phase != BufferRoutingState::ACTIVE) {
254 continue;
255 }
256
258
259 auto root_target = unit.get_buffer(state.to_channel);
260 auto chain_target = unit.get_chain(state.to_channel);
261
262 if (auto mix_proc = chain_target->get_processor<MixProcessor>(root_target)) {
263 mix_proc->update_source_mix(child, state.to_amount);
264 }
265 }
266 }
267}
void update_routing_state(BufferRoutingState &state)
Updates a single buffer's routing state.
TokenUnitManager & m_unit_manager
Reference to the token/unit manager.
bool has_audio_unit(ProcessingToken token) const
Checks if an audio unit exists for the given token.
RootAudioUnit & get_audio_unit_mutable(ProcessingToken token)
Gets an existing audio unit without creating if missing (mutable)
std::shared_ptr< RootAudioBuffer > get_buffer(uint32_t channel) const

References MayaFlux::Buffers::BufferRoutingState::ACTIVE, MayaFlux::Buffers::TokenUnitManager::get_audio_unit_mutable(), MayaFlux::Buffers::RootAudioUnit::get_buffer(), MayaFlux::Buffers::TokenUnitManager::has_audio_unit(), m_unit_manager, and update_routing_state().

+ Here is the call graph for this function: