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

Method process

src/internal/src/AudioDSPKernelProcessor.cpp:38–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void AudioDSPKernelProcessor::process(ContextRenderLock & r, const AudioBus * source, AudioBus * destination, int framesToProcess)
39{
40 ASSERT(source && destination);
41 if (!source || !destination)
42 return;
43
44 if (!isInitialized())
45 {
46 destination->zero();
47 return;
48 }
49
50 size_t src_channels = source->numberOfChannels();
51 size_t dst_channels = destination->numberOfChannels();
52 size_t kernel_count = std::min(src_channels, dst_channels);
53
54 if (m_kernels.size() != dst_channels)
55 {
56 m_kernels.clear();
57 for (int i = 0; i < dst_channels; ++i)
58 m_kernels.push_back(std::unique_ptr<AudioDSPKernel>(createKernel()));
59 }
60
61 bool channelCountMatches = source->numberOfChannels() == destination->numberOfChannels() && source->numberOfChannels() == m_kernels.size();
62 ASSERT(channelCountMatches);
63 if (!channelCountMatches)
64 return;
65
66 for (unsigned i = 0; i < m_kernels.size(); ++i)
67 m_kernels[i]->process(r, source->channel(i)->data(),
68 destination->channel(i)->mutableData(), framesToProcess);
69}
70
71// Resets filter state
72void AudioDSPKernelProcessor::reset()

Callers

nothing calls this directly

Calls 7

sizeMethod · 0.80
clearMethod · 0.80
channelMethod · 0.80
mutableDataMethod · 0.80
zeroMethod · 0.45
numberOfChannelsMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected