MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Process

Method Process

Source/EQModule.cpp:104–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void EQModule::Process(double time)
105{
106 PROFILER(EQModule);
107
108 if (mLiteCpuModulation)
109 {
110 ComputeSliders(0);
111
112 for (auto& filter : mFilters)
113 {
114 if (filter.mEnabled)
115 {
116 bool updated = filter.UpdateCoefficientsIfNecessary();
117 if (updated)
118 mNeedToUpdateFrequencyResponseGraph = true;
119 }
120 }
121 }
122
123 IAudioReceiver* target = GetTarget();
124
125 if (target == nullptr)
126 return;
127
128 SyncBuffers();
129
130 if (mEnabled)
131 {
132 Clear(gWorkBuffer, GetBuffer()->BufferSize());
133
134 ChannelBuffer* out = target->GetBuffer();
135 gWorkChannelBuffer.SetNumActiveChannels(out->NumActiveChannels());
136
137 if (!mLiteCpuModulation) //should we try to recalculate filters every sample?
138 {
139 for (int i = 0; i < GetBuffer()->BufferSize(); ++i)
140 {
141 ComputeSliders(i);
142
143 for (auto& filter : mFilters)
144 {
145 if (filter.mEnabled)
146 {
147 bool updated = filter.UpdateCoefficientsIfNecessary();
148 if (updated)
149 mNeedToUpdateFrequencyResponseGraph = true;
150 }
151 }
152
153 for (int ch = 0; ch < GetBuffer()->NumActiveChannels(); ++ch)
154 {
155 float sample = GetBuffer()->GetChannel(ch)[i];
156 for (auto& filter : mFilters)
157 {
158 if (filter.mEnabled)
159 sample = filter.mFilter[ch].Filter(sample);
160 }
161 gWorkChannelBuffer.GetChannel(ch)[i] = sample;

Callers

nothing calls this directly

Calls 15

ClearFunction · 0.85
BufferCopyFunction · 0.85
AddFunction · 0.85
MultFunction · 0.85
BufferSizeMethod · 0.80
GetBufferMethod · 0.80
SetNumActiveChannelsMethod · 0.80
NumActiveChannelsMethod · 0.80
GetChannelMethod · 0.80
WriteChunkMethod · 0.80
ReadChunkMethod · 0.80

Tested by

no test coverage detected