| 84 | } |
| 85 | |
| 86 | void 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 | |
| 101 | void SpectrumComponent::paint(juce::Graphics& g) |
| 102 | { |
no outgoing calls
no test coverage detected