PulseDPW2(): mFreq(std::numeric_limits<float>::quiet_NaN()), mLastVal0(0), mLastVal1(0) { const float width = in0(1); const float phase = in0(2); mPhase0 = sc_wrap(phase, -1.0f, 1.0f); mPhase1 = sc_wrap(phase + width + width, -1.0f, 1.0f); switch (inRate(0)) { case calc_ScalarRate: { float freq = in0(0); float scale; double phaseIncrement; updateFrequency<true>(freq, scale, phaseIncrement); set_calc_function<PulseDPW2, &PulseDPW2::next_i>(); break; } case calc_BufRate: set_calc_function<PulseDPW2, &PulseDPW2::next_k>(); break; case calc_FullRate: set_calc_function<PulseDPW2, &PulseDPW2::next_a>(); } }
DiodeLadderFilter() { std::fill(z, z + 5, 0); q = hpCutoff = std::numeric_limits<float>::signaling_NaN(); if (inRate(1) == calc_FullRate) set_calc_function<DiodeLadderFilter, &DiodeLadderFilter::next_akk>(); else set_calc_function<DiodeLadderFilter, &DiodeLadderFilter::next_k>(); }
int LH_QtNetwork::tpPermille() const { qint64 div = link_net_out_.maximum().toLongLong() + link_net_in_.maximum().toLongLong(); if( div ) return (inRate() + outRate()) * 1000 / div; return 0; }
int LH_QtNetwork::inPermille() const { if( !link_net_in_.maximum().isNull() ) return inRate() * 1000 / link_net_in_.maximum().toLongLong(); return 0; }