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

Method process

src/core/WaveShaperNode.cpp:91–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void WaveShaperNode::process(ContextRenderLock & r, int bufferSize)
92{
93 if (m_newCurve)
94 {
95 // @TODO mutex
96 std::vector<float>* x = nullptr;
97 std::swap(x, m_newCurve);
98 m_curve = *x;
99 delete x;
100 }
101
102 AudioBus* destinationBus = output(0)->bus(r);
103 if (!isInitialized() || !m_curve.size())
104 {
105 destinationBus->zero();
106 return;
107 }
108
109 AudioBus* sourceBus = input(0)->bus(r);
110 if (!input(0)->isConnected())
111 {
112 destinationBus->zero();
113 return;
114 }
115
116 int srcChannelCount = sourceBus->numberOfChannels();
117 int dstChannelCount = destinationBus->numberOfChannels();
118 if (srcChannelCount != dstChannelCount)
119 {
120 output(0)->setNumberOfChannels(r, srcChannelCount);
121 destinationBus = output(0)->bus(r);
122 }
123
124 for (int i = 0; i < srcChannelCount; ++i)
125 {
126 processBuffer(r, sourceBus->channel(i)->data(), destinationBus->channel(i)->mutableData(), bufferSize);
127 }
128}
129
130} // namespace lab

Callers

nothing calls this directly

Calls 9

sizeMethod · 0.80
channelMethod · 0.80
mutableDataMethod · 0.80
busMethod · 0.45
zeroMethod · 0.45
isConnectedMethod · 0.45
numberOfChannelsMethod · 0.45
setNumberOfChannelsMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected