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

Method numberOfChannels

src/core/AudioNodeInput.cpp:88–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88int AudioNodeInput::numberOfChannels(ContextRenderLock & r) const
89{
90 ChannelCountMode mode = destinationNode()->channelCountMode();
91
92 if (mode == ChannelCountMode::Explicit)
93 {
94 return destinationNode()->channelCount();
95 }
96
97 // Find the number of channels of the connection with the largest number of channels.
98 int maxChannels = 1; // one channel is the minimum allowed
99
100 int c = numberOfRenderingConnections(r);
101 for (int i = 0; i < c; ++i)
102 {
103 auto output = renderingOutput(r, i);
104 if (output)
105 {
106 int c = output->bus(r)->numberOfChannels();
107 if (c > maxChannels)
108 maxChannels = c;
109 }
110 }
111
112 if (mode == ChannelCountMode::ClampedMax)
113 {
114 maxChannels = min(maxChannels, destinationNode()->channelCount());
115 }
116
117 return maxChannels;
118}
119
120AudioBus * AudioNodeInput::bus(ContextRenderLock & r)
121{

Callers 15

processMethod · 0.45
processMethod · 0.45
processMethod · 0.45
processMethod · 0.45
processMethod · 0.45
processMethod · 0.45
processPolyBLEPMethod · 0.45
processMethod · 0.45
processMethod · 0.45
processMethod · 0.45
processMethod · 0.45
setGrainSourceMethod · 0.45

Calls 3

channelCountModeMethod · 0.80
channelCountMethod · 0.80
busMethod · 0.45

Tested by 1

processMethod · 0.36