| 77 | bool wasInhibited = false; // was this burst inhibited (i.e. just the first trigger sent) |
| 78 | |
| 79 | std::tuple<float, float, bool> process(float sampleTime) { |
| 80 | |
| 81 | if (active) { |
| 82 | burstTimer.process(sampleTime); |
| 83 | } |
| 84 | |
| 85 | bool eocTriggered = false; |
| 86 | if (burstTimer.time > timings[triggersOccurred]) { |
| 87 | if (triggersOccurred < triggersRequested) { |
| 88 | burstOutput.reset(); |
| 89 | burstOutput.trigger(TRIGGER_TIME); |
| 90 | } |
| 91 | else if (triggersOccurred == triggersRequested) { |
| 92 | eocOutput.reset(); |
| 93 | eocOutput.trigger(TRIGGER_TIME); |
| 94 | active = false; |
| 95 | eocTriggered = true; |
| 96 | } |
| 97 | triggersOccurred++; |
| 98 | } |
| 99 | |
| 100 | const float burstOut = burstOutput.process(sampleTime); |
| 101 | // NOTE: we don't get EOC if the burst was inhibited |
| 102 | const float eocOut = eocOutput.process(sampleTime) * !wasInhibited; |
| 103 | return std::make_tuple(burstOut, eocOut, eocTriggered); |
| 104 | } |
| 105 | |
| 106 | void trigger(int numBursts, int multDiv, float baseTimeWindow, float distribution, bool inhibitBurst, bool includeOriginalTrigger) { |
| 107 | |