summaryrefslogtreecommitdiffstats
path: root/src/app/analyzer.cpp
diff options
context:
space:
mode:
authormio <[email protected]>2024-11-10 19:39:43 +1000
committermio <[email protected]>2025-01-11 12:12:32 +1000
commit5cfecec40972f7d6f77879e1209bc10d6019625b (patch)
treeb94f3a2565f83e61821d1a8544f156cda42a4f41 /src/app/analyzer.cpp
parente023e2eafb5dc39fe11595f343d867ac6ebe7f5b (diff)
downloadcodeine-5cfecec40972f7d6f77879e1209bc10d6019625b.tar.gz
codeine-5cfecec40972f7d6f77879e1209bc10d6019625b.zip
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 <[email protected]>
Diffstat (limited to 'src/app/analyzer.cpp')
-rw-r--r--src/app/analyzer.cpp7
1 files changed, 6 insertions, 1 deletions
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()