MCPcopy Create free account
hub / github.com/DISTRHO/DPF / sampleRateChanged

Function sampleRateChanged

examples/Latency/LatencyExamplePlugin.cpp:232–242  ·  view source on GitHub ↗

Optional callback to inform the plugin about a sample rate change. This function will only be called when the plugin is deactivated. */

Source from the content-addressed store, hash-verified

230 This function will only be called when the plugin is deactivated.
231 */
232 void sampleRateChanged(double newSampleRate) override
233 {
234 fBufferSize = newSampleRate*6; // 6 seconds
235
236 delete[] fBuffer;
237 fBuffer = new float[fBufferSize];
238 // buffer reset is done during activate()
239
240 fLatencyInFrames = fLatency*newSampleRate;
241 setLatency(fLatencyInFrames);
242 }
243
244 // -------------------------------------------------------------------------------------------------------
245

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected