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

Method sumFrom

src/core/AudioBus.cpp:271–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271void AudioBus::sumFrom(const AudioBus & sourceBus, ChannelInterpretation channelInterpretation)
272{
273 if (&sourceBus == this) return;
274
275 int numberOfSourceChannels = sourceBus.numberOfChannels();
276 int numberOfDestinationChannels = numberOfChannels();
277
278 if (numberOfDestinationChannels == numberOfSourceChannels)
279 {
280 for (int i = 0; i < numberOfSourceChannels; ++i)
281 {
282 channel(i)->sumFrom(sourceBus.channel(i));
283 }
284 }
285 else
286 {
287 switch (channelInterpretation)
288 {
289 case ChannelInterpretation::Speakers: speakersSumFrom(sourceBus); break;
290 case ChannelInterpretation::Discrete: discreteSumFrom(sourceBus); break;
291 default:
292 ASSERT_NOT_REACHED();
293 }
294 }
295}
296
297void AudioBus::speakersCopyFrom(const AudioBus & sourceBus)
298{

Callers 5

pullMethod · 0.45
calculateFinalValuesMethod · 0.45
speakersSumFromMethod · 0.45
discreteSumFromMethod · 0.45
processMethod · 0.45

Calls 2

channelMethod · 0.80
numberOfChannelsMethod · 0.45

Tested by

no test coverage detected