Re: foo_vis_spectrum_analyzer
Reply #785 – 2024-05-02 16:40:13

Based on how your plugin behaves/displays I guess you are calculating barwidth (vertical peakmeter) by first determining the total gauge gap by first multiplying the (unscaled) configuration value gauge gap times the number of channels (bars) to be displayed minus 1. Then I guess you scale this total gauge gap, subtract that value from the panelwidth and divide the result by the number of channels to find barwidth per bar. By scaling a calculated unscaled total gauge gap this value will be to high (except winth 200% and 300%), and subsequently your barwidth/barheight will be lower than I intended. When you display bars, you apply single gauge gaps between channels leading to pixels that are left over and are distributed to the left of leftmost bar and to the right of rightmost bar. You don't have to guess. The code is out in the open... ;-) That's almost exactly how the metrics are determined.Please investigate ... Will do. I did check your code several times, but I'm not a C++ programmer. I did read that C++ also has const INTEGER. My best guess is that 1 of these 4 FLOAT's has a decimal value instead of a truncated INTEGER value in case of other windows scaling than 100%, 200%, 300%: const FLOAT n = (FLOAT) _Analysis->_GaugeValues.size(); const FLOAT TotalBarGap = _State->_GaugeGap * (n - 1); const FLOAT TickSize = 2.f; const FLOAT TotalTickSize = (_GraphSettings->_YAxisLeft ? TickSize : 0.f) + (_GraphSettings->_YAxisRight ? TickSize : 0.f); which means that this line will produce a barheight that is too small in any scaling other than 100%, 200% and 300% which leads to an offset that is bigger than should be const FLOAT BarHeight = ::floor((_ClientSize.height - TotalBarGap - TotalTickSize) / n); Anyway, I'm happy you are investigating. It's quite easy to spot when you put your scaling to 125% and display a 6ch peakmeter.