| 116 | } |
| 117 | |
| 118 | void Random8Core::process(float deltaSeconds) { |
| 119 | if (deltaSeconds <= 0.0f) { |
| 120 | return; |
| 121 | } |
| 122 | |
| 123 | impl_->controlAccumulator += std::min(deltaSeconds, kMaxAccumulatedProcessSeconds); |
| 124 | while (impl_->controlAccumulator >= kHardwareControlPeriodSeconds) { |
| 125 | for (int i = 0; i < R8::NUM_CHANNELS; i++) { |
| 126 | impl_->outputs[i] = |
| 127 | impl_->channels[i].process_val(impl_->channels[i].data.currentVal, kHardwareControlPeriodSeconds); |
| 128 | } |
| 129 | impl_->controlAccumulator -= kHardwareControlPeriodSeconds; |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | float Random8Core::getOutputVolts(int channel) const { |
| 134 | if (channel < 0 || channel >= R8::NUM_CHANNELS) { |
nothing calls this directly
no test coverage detected