BogaudioModules

BogaudioModules for VCV Rack
Log | Files | Refs | README | LICENSE

commit 266a2357fed74cfb1cf2ff0ef26304e0b1b6666a
parent 64abffe2dfe245f06294aa9041da2007cb76919e
Author: Matt Demanett <matt@demanett.net>
Date:   Mon,  4 Dec 2017 22:53:00 -0800

Fix compile warnings on Windows build.

Diffstat:
Msrc/Analyzer.cpp | 12++++--------
Msrc/dsp/analyzer.hpp | 2+-
Msrc/dsp/noise.hpp | 6+++---
3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/Analyzer.cpp b/src/Analyzer.cpp @@ -158,14 +158,10 @@ void Analyzer::resetChannels() { } SpectrumAnalyzer::Size Analyzer::size() { - switch (_quality) { - case QUALITY_HIGH: { - return SpectrumAnalyzer::SIZE_4096; - } - case QUALITY_GOOD: { - return SpectrumAnalyzer::SIZE_1024; - } + if (_quality == QUALITY_HIGH) { + return SpectrumAnalyzer::SIZE_4096; } + return SpectrumAnalyzer::SIZE_1024; } void Analyzer::step() { @@ -454,7 +450,7 @@ void AnalyzerDisplay::drawXAxisLine(NVGcontext* vg, float hz, float maxHz) { } void AnalyzerDisplay::drawGraph(NVGcontext* vg, float* bins, int binsN, NVGcolor color, float strokeWidth) { - const int pointsN = roundf(_module->_range*(_module->size()/2)); + const int pointsN = roundf(_module->_range*(_module->size()/2)); nvgSave(vg); nvgScissor(vg, _insetLeft, _insetTop, _graphSize.x, _graphSize.y); nvgStrokeColor(vg, color); diff --git a/src/dsp/analyzer.hpp b/src/dsp/analyzer.hpp @@ -162,7 +162,7 @@ struct SpectrumAnalyzer : OverlappingBuffer<float> { delete[] _fftOut; } - virtual void process(float* samples) { + virtual void process(float* samples) override { float* input = samples; if (_window) { _window->apply(samples, _windowOut); diff --git a/src/dsp/noise.hpp b/src/dsp/noise.hpp @@ -9,7 +9,7 @@ struct WhiteNoiseGenerator : NoiseGenerator { const float _randMax = powf(2.0, 31) - 1; int _last = rack::randomu32(); - virtual float _next() { + virtual float _next() override { // don't use this for cryptography. _last = ((_last * 1103515245) + 12345) & _mask; return _last / _randMax; @@ -23,7 +23,7 @@ struct BasePinkNoiseGenerator : NoiseGenerator { G _gs[_n]; uint32_t _count = rack::randomu32(); - virtual float _next() { + virtual float _next() override { // See: http://www.firstpr.com.au/dsp/pink-noise/ float sum = _g.next(); for (int i = 0, bit = 1; i < _n; ++i, bit <<= 1) { @@ -46,7 +46,7 @@ struct RedNoiseGenerator : BasePinkNoiseGenerator<PinkNoiseGenerator> {}; struct GaussianNoiseGenerator : NoiseGenerator { GaussianNoiseGenerator() {} - virtual float _next() { + virtual float _next() override { return rack::randomNormal(); } };