MCPcopy Create free account
hub / github.com/jerryuhoo/Fire / updateSpectrum

Method updateSpectrum

Source/Panels/SpectrogramPanel/SpectrumComponent.cpp:86–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void SpectrumComponent::updateSpectrum(const float* newData, int numBins, float binWidth)
87{
88 // This method is called from the audio thread.
89 // It just copies the new data; all smoothing is now on the message thread.
90 {
91 juce::ScopedLock locker(dataLock);
92 numberOfBins = std::min(numBins, (int) spectrumData.size());
93 mBinWidth = binWidth;
94
95 // Directly copy the new data into the spectrumData buffer
96 std::copy(newData, newData + numberOfBins, spectrumData.begin());
97 }
98 // No need to call triggerAsyncUpdate() anymore.
99}
100
101void SpectrumComponent::paint(juce::Graphics& g)
102{

Callers 2

timerCallbackMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected