From 5cfecec40972f7d6f77879e1209bc10d6019625b Mon Sep 17 00:00:00 2001 From: mio Date: Sun, 10 Nov 2024 19:39:43 +1000 Subject: Create a AudioView widget for audio-only streams Currently Codeine will show a blank area when playing an audio-only file, such as music. This patch adds a new widget that contains an instance of the Analyzer::Block class, so instead of a blank area it contains a "visualizer" of sorts. Signed-off-by: mio --- src/app/analyzer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/app/analyzer.cpp') diff --git a/src/app/analyzer.cpp b/src/app/analyzer.cpp index 7a80872..97b9aa3 100644 --- a/src/app/analyzer.cpp +++ b/src/app/analyzer.cpp @@ -585,7 +585,12 @@ void Analyzer::Block::determineStep() // I calculated the value 30 based on some trial and error const double fallTime = 30 * m_rows; - m_step = double(m_rows * 80) / fallTime; // 80 = ~milliseconds between signals with audio data + + // The number of milliseconds between signals with audio data is about 80, + // however, basing the step off of that value causes some undersireable + // effects in the analyzer (high-end blocks constantly appearing/disappearing). + // 44 seems to be a good mid-point. + m_step = double(m_rows * 44) / fallTime; } void Analyzer::Block::drawBackground() -- cgit v1.2.3