settings, toggles, and more

This commit is contained in:
Boof2015
2026-08-14 19:02:26 -04:00
parent e712421bad
commit c45451476d
17 changed files with 2144 additions and 66 deletions
+33
View File
@@ -1,20 +1,39 @@
#pragma once
#include "lufsmeter.h"
#include "oscilloscope.h"
#include "spectrum.h"
#include "spectrum_peak_model.h"
#include "system_audio_capture.h"
#include "vectorscope.h"
#include "vumeter.h"
#include <vector>
#include <optional>
namespace Prism::Tui {
constexpr size_t kDefaultFftSize = 4096;
constexpr size_t kVectorscopeDisplayPoints = 4096;
struct OscilloscopeFrame {
std::vector<float> samples;
float detectedPitch = 0.0f;
bool signalPresent = false;
};
struct VectorscopeFrame {
std::vector<float> multibandPoints;
size_t pointCount = 0;
};
struct AnalysisFrame {
std::vector<float> magnitudes;
std::optional<SpectrumPeakInfo> spectrumPeak;
Visualizer::VUMeterSnapshot vu{};
Visualizer::LUFSMeterSnapshot lufs{};
OscilloscopeFrame oscilloscope;
VectorscopeFrame vectorscope;
};
class AnalysisPipeline {
@@ -24,11 +43,25 @@ public:
void process(const Prism::Capture::AudioChunk& chunk);
AnalysisFrame snapshot();
void reset();
void setInputTrimDb(float db);
void setSpectrumTilt(float dbPerOctave);
void setOscilloscopePitchLock(bool enabled);
private:
Visualizer::Spectrum spectrum_;
Visualizer::VUMeterAnalyzer vu_;
Visualizer::LUFSMeterAnalyzer lufs_;
Visualizer::Oscilloscope oscilloscope_;
Visualizer::Vectorscope vectorscope_;
SpectrumPeakTracker spectrumPeakTracker_;
std::vector<float> monoScratch_;
std::vector<float> trimmedLeftScratch_;
std::vector<float> trimmedRightScratch_;
float sampleRate_ = 48000.0f;
size_t fftSize_ = kDefaultFftSize;
float inputGainLinear_ = 1.0f;
float spectrumTiltDbPerOctave_ = 2.0f;
float displayPitch_ = 0.0f;
};
size_t drainCapture(Prism::Capture::SystemAudioCapture& capture,