| 45 | } |
| 46 | |
| 47 | void AudioBasicProcessorNode::process(ContextRenderLock & r, int bufferSize) |
| 48 | { |
| 49 | AudioBus * destinationBus = output(0)->bus(r); |
| 50 | |
| 51 | if (!isInitialized() || !processor()) |
| 52 | destinationBus->zero(); |
| 53 | else |
| 54 | { |
| 55 | AudioBus * sourceBus = input(0)->bus(r); |
| 56 | |
| 57 | // FIXME: if we take "tail time" into account, then we can avoid calling processor()->process() once the tail dies down. |
| 58 | if (!input(0)->isConnected()) |
| 59 | { |
| 60 | sourceBus->zero(); |
| 61 | return; |
| 62 | } |
| 63 | |
| 64 | int srcChannelCount = sourceBus->numberOfChannels(); |
| 65 | int dstChannelCount = destinationBus->numberOfChannels(); |
| 66 | if (srcChannelCount != dstChannelCount) |
| 67 | { |
| 68 | output(0)->setNumberOfChannels(r, srcChannelCount); |
| 69 | destinationBus = output(0)->bus(r); |
| 70 | } |
| 71 | |
| 72 | // process entire buffer |
| 73 | processor()->process(r, sourceBus, destinationBus, bufferSize); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | |
| 78 | void AudioBasicProcessorNode::reset(ContextRenderLock &) |
nothing calls this directly
no test coverage detected