From 9123295b7daef2116e8bc5bade5dbbcc3549d73f Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 7 Jan 2024 20:26:22 -0500 Subject: [PATCH] (Do I need this too?) --- .../wavetrack/ui/WaveTrackMeter.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/tracks/playabletrack/wavetrack/ui/WaveTrackMeter.cpp b/src/tracks/playabletrack/wavetrack/ui/WaveTrackMeter.cpp index 9481596cf374..e69bcf37239b 100644 --- a/src/tracks/playabletrack/wavetrack/ui/WaveTrackMeter.cpp +++ b/src/tracks/playabletrack/wavetrack/ui/WaveTrackMeter.cpp @@ -9,10 +9,12 @@ **********************************************************************/ #include "WaveTrackMeter.h" +#include "ActiveProject.h" #include "AllThemeResources.h" #include "Decibels.h" #include "PeakAndRmsMeter.h" #include "../../../../widgets/MeterPainter.h" +#include "TrackPanel.h" #include "TransportUtilities.h" #include "WaveTrack.h" @@ -47,7 +49,19 @@ struct WaveTrackRmsMeter wxTimer::Start(1000 / mMeterRefreshRate); } - void Notify() override { PeakAndRmsMeter::Poll(); } + void Notify() override { + mNumChanges = 0; + PeakAndRmsMeter::Poll(); + if (mNumChanges) { + if (auto pProject = GetActiveProject().lock()) + TrackPanel::Get(*pProject).Refresh(); + } + } + void Receive(double, const MeterUpdateMsg &) override { + ++mNumChanges; + } + + unsigned mNumChanges{}; }; int ChooseBgColor(bool selected) {