commit e60237c7cc0ff6a0a62e08e10fcde88b7fbb1a6e
parent e784bd6972beeb64f19dea0edc8ed3c04cc6eb72
Author: Matt Demanett <matt@demanett.net>
Date: Sun, 30 Dec 2018 23:34:55 -0500
Spaces to tabs.
Diffstat:
2 files changed, 57 insertions(+), 57 deletions(-)
diff --git a/src/analyzer_base.cpp b/src/analyzer_base.cpp
@@ -3,19 +3,19 @@
#include "dsp/signal.hpp"
ChannelAnalyzer::~ChannelAnalyzer() {
- {
- std::lock_guard<std::mutex> lock(_workerMutex);
- _workerStop = true;
- }
- _workerCV.notify_one();
- _worker.join();
- delete[] _workerBuf;
- delete[] _stepBuf;
+ {
+ std::lock_guard<std::mutex> lock(_workerMutex);
+ _workerStop = true;
+ }
+ _workerCV.notify_one();
+ _worker.join();
+ delete[] _workerBuf;
+ delete[] _stepBuf;
delete[] _bins0;
delete[] _bins1;
- if (_averagedBins) {
- delete _averagedBins;
- }
+ if (_averagedBins) {
+ delete _averagedBins;
+ }
}
float ChannelAnalyzer::getPeak() {
@@ -102,32 +102,32 @@ void ChannelAnalyzer::work() {
void AnalyzerCore::setParams(int averageN, Quality quality, Window window) {
- bool reset = false;
- if (_averageN != averageN) {
- _averageN = averageN;
- reset = true;
- }
- if (_quality != quality) {
- _quality = quality;
- reset = true;
- }
- if (_window != window) {
- _window = window;
- reset = true;
- }
- if (reset) {
- resetChannels();
- }
+ bool reset = false;
+ if (_averageN != averageN) {
+ _averageN = averageN;
+ reset = true;
+ }
+ if (_quality != quality) {
+ _quality = quality;
+ reset = true;
+ }
+ if (_window != window) {
+ _window = window;
+ reset = true;
+ }
+ if (reset) {
+ resetChannels();
+ }
}
void AnalyzerCore::resetChannels() {
std::lock_guard<std::mutex> lock(_channelsMutex);
- for (int i = 0; i < _nChannels; ++i) {
- if (_channels[i]) {
- delete _channels[i];
- _channels[i] = NULL;
- }
- }
+ for (int i = 0; i < _nChannels; ++i) {
+ if (_channels[i]) {
+ delete _channels[i];
+ _channels[i] = NULL;
+ }
+ }
}
SpectrumAnalyzer::Size AnalyzerCore::size() {
@@ -174,8 +174,8 @@ SpectrumAnalyzer::WindowType AnalyzerCore::window() {
}
void AnalyzerCore::stepChannel(int channelIndex, Input& input) {
- assert(channelIndex >= 0);
- assert(channelIndex < _nChannels);
+ assert(channelIndex >= 0);
+ assert(channelIndex < _nChannels);
if (input.active) {
if (!_channels[channelIndex]) {
@@ -226,10 +226,10 @@ void AnalyzerDisplay::drawBackground(NVGcontext* vg) {
nvgRect(vg, 0, 0, _size.x, _size.y);
nvgFillColor(vg, nvgRGBA(0x00, 0x00, 0x00, 0xff));
nvgFill(vg);
- if (_drawInset) {
- nvgStrokeColor(vg, nvgRGBA(0xc0, 0xc0, 0xc0, 0xff));
- nvgStroke(vg);
- }
+ if (_drawInset) {
+ nvgStrokeColor(vg, nvgRGBA(0xc0, 0xc0, 0xc0, 0xff));
+ nvgStroke(vg);
+ }
nvgRestore(vg);
}
@@ -246,18 +246,18 @@ void AnalyzerDisplay::drawHeader(NVGcontext* vg) {
drawText(vg, s, x, _insetTop + textY);
x += n * charPx - 0;
- int spacing = 3;
- if (_size.x > 300) {
- x += 5;
- spacing = 20;
- }
+ int spacing = 3;
+ if (_size.x > 300) {
+ x += 5;
+ spacing = 20;
+ }
for (int i = 0; i < _module->_core._nChannels; ++i) {
ChannelAnalyzer* channel = _module->_core._channels[i];
if (channel) {
- snprintf(s, sLen, "%c:%7.1f", 'A' + i, channel->getPeak());
- drawText(vg, s, x, _insetTop + textY, 0.0, &_channelColors[i % channelColorsN]);
+ snprintf(s, sLen, "%c:%7.1f", 'A' + i, channel->getPeak());
+ drawText(vg, s, x, _insetTop + textY, 0.0, &_channelColors[i % channelColorsN]);
}
- x += 9 * charPx + spacing;
+ x += 9 * charPx + spacing;
}
nvgRestore(vg);
diff --git a/src/analyzer_base.hpp b/src/analyzer_base.hpp
@@ -76,7 +76,7 @@ struct AnalyzerCore {
WINDOW_KAISER
};
- int _nChannels;
+ int _nChannels;
ChannelAnalyzer** _channels;
int _averageN = 1;
Quality _quality = QUALITY_GOOD;
@@ -86,15 +86,15 @@ struct AnalyzerCore {
std::mutex _channelsMutex;
AnalyzerCore(int nChannels)
- : _nChannels(nChannels)
- , _channels(new ChannelAnalyzer*[_nChannels] {})
- {}
+ : _nChannels(nChannels)
+ , _channels(new ChannelAnalyzer*[_nChannels] {})
+ {}
virtual ~AnalyzerCore() {
resetChannels();
- delete[] _channels;
+ delete[] _channels;
}
- void setParams(int averageN, Quality quality, Window window);
+ void setParams(int averageN, Quality quality, Window window);
void resetChannels();
SpectrumAnalyzer::Size size();
SpectrumAnalyzer::WindowType window();
@@ -107,10 +107,10 @@ struct AnalyzerBase : Module {
float _rangeDb = 80.0f;
AnalyzerCore _core;
- AnalyzerBase(int nChannels, int np, int ni, int no, int nl)
- : Module(np, ni, no, nl)
- , _core(nChannels)
- {}
+ AnalyzerBase(int nChannels, int np, int ni, int no, int nl)
+ : Module(np, ni, no, nl)
+ , _core(nChannels)
+ {}
};
struct AnalyzerDisplay : TransparentWidget {