some more refactoring

- UIState.h: Replaced C-style arrays bool[] and ImVec4[] with
std::array<bool, kMaxChannels> and std::array<ImVec4, kMaxChannels> for
type safety and STL compatibility.
  - Application.cpp: Extracted duplicated DPI calculation (lines 189-196
and 475-481) into a systemDpiScale() helper method, reducing both call
sites to single-line calls.
  - Application.cpp: Replaced magic 1400, 900 window dimensions with
kDefaultWindowWidth/kDefaultWindowHeight constants (defined in Types.h).
  - AudioEngine.cpp: Named the magic epsilon thresholds 1e-20f →
kLinearEpsilon and 1e-30f → kLogGuard with explanatory comments, defined
in an anonymous namespace.
  - Types.h: Added kDefaultWindowWidth and kDefaultWindowHeight
constants.
This commit is contained in:
2026-03-28 16:09:29 +01:00
parent b42d7fb69b
commit baf6fd94cc
11 changed files with 105 additions and 109 deletions

View File

@@ -42,9 +42,6 @@ public:
float spectrumFrac = 0.35f;
bool draggingSplit = false;
// Returns true if split was just released (caller should save config).
bool splitReleased();
private:
void handleSpectrumInput(AudioEngine& audio, UIState& ui,
SpectrumDisplay& specDisplay, Cursors& cursors,
@@ -60,8 +57,6 @@ private:
float lastDist = 0.0f;
} touch_;
bool splitWasReleased_ = false;
// Scratch buffers
std::vector<std::vector<float>> wfSpectraScratch_;
std::vector<WaterfallChannelInfo> wfChInfoScratch_;