void DspRate::Initialize(bool variable, uint32_t inputRate, uint32_t outputRate, uint32_t channels) { DestroyBackends(); m_state = State::Passthrough; m_inStateTransition = false; m_transitionCorrelation = {}; m_transitionChunks = {}; m_inputRate = inputRate; m_outputRate = outputRate; m_channels = channels; m_variableInputFrames = 0; m_variableOutputFrames = 0; m_variableDelay = 0; m_adjustTime = 0; if (variable) { m_state = State::Variable; CreateBackend(); assert(m_soxrv); } else if (inputRate != outputRate) { m_state = State::Constant; CreateBackend(); assert(m_soxrc); } }
void DspRate::Adjust(REFERENCE_TIME time) { if (m_state != State::Variable) { m_state = State::Variable; CreateBackend(); assert(m_soxrv); m_inStateTransition = true; } m_adjustTime += time; }
Backend* BackendFactory::CreateBackend(BackendTpye type) { return CreateBackend(type, "", "", "", "", "", 0); }