Processes the source to destination bus.
| 39 | |
| 40 | // Processes the source to destination bus. |
| 41 | virtual void process(ContextRenderLock &, |
| 42 | const lab::AudioBus * source, lab::AudioBus * destination, |
| 43 | int framesToProcess) override |
| 44 | { |
| 45 | if (!source->numberOfChannels() || !destination->numberOfChannels()) |
| 46 | return; |
| 47 | |
| 48 | const float * carrierP = source->channelByType(Channel::Left)->data(); |
| 49 | const float * modP = source->channelByType(Channel::Right)->data(); |
| 50 | |
| 51 | if (!modP && carrierP) |
| 52 | { |
| 53 | destination->copyFrom(*source); |
| 54 | } |
| 55 | else if (modP && carrierP) |
| 56 | { |
| 57 | float * destP = destination->channel(0)->mutableData(); |
| 58 | int n = framesToProcess; |
| 59 | while (n--) |
| 60 | { |
| 61 | float carrier = *carrierP++; |
| 62 | float mod = *modP++; |
| 63 | *destP++ = (carrier > mod) ? 1.0f : -1.0f; |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | virtual void reset() override {} |
| 69 |
nothing calls this directly
no test coverage detected