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

◆ update_routing_state()

void MayaFlux::Buffers::BufferSupplyMixing::update_routing_state ( BufferRoutingState state)
private

Updates a single buffer's routing state.

Parameters
stateRouting state to update

Definition at line 310 of file BufferSupplyMixing.cpp.

311{
312 state.cycles_elapsed++;
313
314 double progress = 0.0;
315 if (state.fade_cycles > 0) {
316 progress = std::min(1.0, static_cast<double>(state.cycles_elapsed) / state.fade_cycles);
317 } else {
318 state.from_amount = 0.0;
319 state.to_amount = 1.0;
320 state.phase = BufferRoutingState::COMPLETED;
321 return;
322 }
323
324 state.from_amount = 1.0 - progress;
325 state.to_amount = progress;
326
327 if (state.cycles_elapsed >= state.fade_cycles) {
328 state.phase = BufferRoutingState::COMPLETED;
329 }
330}

References MayaFlux::Buffers::BufferRoutingState::COMPLETED, MayaFlux::Buffers::BufferRoutingState::cycles_elapsed, MayaFlux::Buffers::BufferRoutingState::fade_cycles, MayaFlux::Buffers::BufferRoutingState::from_amount, and MayaFlux::Buffers::BufferRoutingState::to_amount.

Referenced by update_routing_states_for_cycle().

+ Here is the caller graph for this function: