From 911237e281622348947d8aa746a5c96577f319bd Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sun, 19 Jan 2025 09:42:00 +0100 Subject: [PATCH] AnalyzerBase: Add missing parameter names --- src/analyzer/analyzerbase.cpp | 20 ++++++++++---------- src/analyzer/analyzerbase.h | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/analyzer/analyzerbase.cpp b/src/analyzer/analyzerbase.cpp index 3b74e4cf9..700bffd15 100644 --- a/src/analyzer/analyzerbase.cpp +++ b/src/analyzer/analyzerbase.cpp @@ -50,9 +50,9 @@ // Make an INSTRUCTIONS file // can't mod scope in analyze you have to use transform for 2D use setErasePixmap Qt function insetead of m_background -AnalyzerBase::AnalyzerBase(QWidget *parent, const uint scopeSize) +AnalyzerBase::AnalyzerBase(QWidget *parent, const uint scope_size) : QWidget(parent), - fht_(new FHT(scopeSize)), + fht_(new FHT(scope_size)), engine_(nullptr), lastscope_(512), new_frame_(false), @@ -211,28 +211,28 @@ void AnalyzerBase::demo(QPainter &p) { } -void AnalyzerBase::interpolate(const Scope &inVec, Scope &outVec) { +void AnalyzerBase::interpolate(const Scope &in_scope, Scope &out_scope) { double pos = 0.0; - const double step = static_cast(inVec.size()) / static_cast(outVec.size()); + const double step = static_cast(in_scope.size()) / static_cast(out_scope.size()); - for (uint i = 0; i < outVec.size(); ++i, pos += step) { + for (uint i = 0; i < out_scope.size(); ++i, pos += step) { const double error = pos - std::floor(pos); const uint64_t offset = static_cast(pos); uint64_t indexLeft = offset + 0; - if (indexLeft >= inVec.size()) { - indexLeft = inVec.size() - 1; + if (indexLeft >= in_scope.size()) { + indexLeft = in_scope.size() - 1; } uint64_t indexRight = offset + 1; - if (indexRight >= inVec.size()) { - indexRight = inVec.size() - 1; + if (indexRight >= in_scope.size()) { + indexRight = in_scope.size() - 1; } - outVec[i] = inVec[indexLeft] * (1.0F - static_cast(error)) + inVec[indexRight] * static_cast(error); + out_scope[i] = in_scope[indexLeft] * (1.0F - static_cast(error)) + in_scope[indexRight] * static_cast(error); } } diff --git a/src/analyzer/analyzerbase.h b/src/analyzer/analyzerbase.h index b7263e608..ecede3bd4 100644 --- a/src/analyzer/analyzerbase.h +++ b/src/analyzer/analyzerbase.h @@ -61,7 +61,7 @@ class AnalyzerBase : public QWidget { protected: using Scope = std::vector; - explicit AnalyzerBase(QWidget*, const uint scopeSize = 7); + explicit AnalyzerBase(QWidget *parent, const uint scope_size = 7); void hideEvent(QHideEvent *e) override; void showEvent(QShowEvent *e) override; @@ -71,12 +71,12 @@ class AnalyzerBase : public QWidget { int resizeExponent(int exp); int resizeForBands(const int bands); virtual void init() {} - virtual void transform(Scope&); - virtual void analyze(QPainter &p, const Scope&, const bool new_frame) = 0; + virtual void transform(Scope &scope); + virtual void analyze(QPainter &p, const Scope &s, const bool new_frame) = 0; virtual void demo(QPainter &p); - void interpolate(const Scope&, Scope&); - void initSin(Scope&, const uint = 6000); + void interpolate(const Scope &in_scope, Scope &out_scope); + void initSin(Scope &v, const uint size = 6000); protected: QBasicTimer timer_;