MCPcopy Create free account
hub / github.com/LabSound/LabSound / process

Method process

src/core/ChannelSplitterNode.cpp:40–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void 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
67void ChannelSplitterNode::reset(ContextRenderLock &)
68{

Callers

nothing calls this directly

Calls 7

channelMethod · 0.80
renderingFanOutCountMethod · 0.80
busMethod · 0.45
lengthMethod · 0.45
numberOfChannelsMethod · 0.45
copyFromMethod · 0.45
zeroMethod · 0.45

Tested by

no test coverage detected