From 970ebe63fd8071b78a2cfb8c19326fc68b2a0af2 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Mon, 14 Dec 2020 18:15:47 +0100 Subject: Call InitVisualization() on resize --- src/screens/visualizer.cpp | 7 ++++--- src/screens/visualizer.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/screens/visualizer.cpp b/src/screens/visualizer.cpp index ce0f3eca..aae1482b 100644 --- a/src/screens/visualizer.cpp +++ b/src/screens/visualizer.cpp @@ -80,7 +80,7 @@ Visualizer::Visualizer() #endif { ResetFD(); - SetVisualizationType(); + InitVisualization(); # ifdef HAVE_FFTW3_H m_fftw_results = DFT_TOTAL_SIZE/2+1; m_freq_magnitudes.resize(m_fftw_results); @@ -114,6 +114,7 @@ void Visualizer::resize() w.resize(width, MainHeight); w.moveTo(x_offset, MainStartY); hasToBeResized = 0; + InitVisualization(); # ifdef HAVE_FFTW3_H GenLogspace(); m_bar_heights.reserve(w.getWidth()); @@ -593,7 +594,7 @@ void Visualizer::GenLogspace() } #endif // HAVE_FFTW3_H -void Visualizer::SetVisualizationType() +void Visualizer::InitVisualization() { switch (Config.visualizer_type) { @@ -660,7 +661,7 @@ void Visualizer::ToggleVisualizationType() Config.visualizer_type = VisualizerType::Wave; break; } - SetVisualizationType(); + InitVisualization(); Statusbar::printf("Visualization type: %1%", Config.visualizer_type); } diff --git a/src/screens/visualizer.h b/src/screens/visualizer.h index 099b2080..d3b8de4f 100644 --- a/src/screens/visualizer.h +++ b/src/screens/visualizer.h @@ -77,7 +77,7 @@ private: double Interpolate(size_t, size_t); # endif // HAVE_FFTW3_H - void SetVisualizationType(); + void InitVisualization(); void (Visualizer::*draw)(const int16_t *, ssize_t, size_t, size_t); void (Visualizer::*drawStereo)(const int16_t *, const int16_t *, ssize_t, size_t); -- cgit v1.2.3