| 38 | } |
| 39 | |
| 40 | void ChannelSplitterNode::process(ContextRenderLock & r, int bufferSize) |
| 41 | { |
| 42 | AudioBus * source = input(0)->bus(r); |
| 43 | ASSERT(source); |
| 44 | ASSERT_UNUSED(bufferSize, bufferSize == source->length()); |
| 45 | |
| 46 | size_t numberOfSourceChannels = source->numberOfChannels(); |
| 47 | |
| 48 | for (int i = 0; i < numberOfOutputs(); ++i) |
| 49 | { |
| 50 | AudioBus * destination = output(i)->bus(r); |
| 51 | ASSERT(destination); |
| 52 | |
| 53 | if (i < numberOfSourceChannels) |
| 54 | { |
| 55 | // Split the channel out if it exists in the source. |
| 56 | // It would be nice to avoid the copy and simply pass along pointers, but this becomes extremely difficult with fanout and fanin. |
| 57 | destination->channel(0)->copyFrom(source->channel(i)); |
| 58 | } |
| 59 | else if (output(i)->renderingFanOutCount() > 0) |
| 60 | { |
| 61 | // Only bother zeroing out the destination if it's connected to anything |
| 62 | destination->zero(); |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | void ChannelSplitterNode::reset(ContextRenderLock &) |
| 68 | { |
nothing calls this directly
no test coverage detected