From 17d2a17f9ed85d31cb7ba76ba49e30258983bb0b Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 15 Jan 2018 09:38:18 -0800 Subject: [PATCH] UI: Put clip detection back in to volume meter Before the new volume meters were implemented, the meter would flash red if the audio was clipping. This functionality was removed when the meters were changed, whether intentionally or unintentionally, and this patch puts that functionality back in. If clipping occurs, the meters will be fully colored with the foregroundErrorColor value while the clipping is occurring. --- UI/volume-control.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/UI/volume-control.cpp b/UI/volume-control.cpp index 544d876eb..02dec0a6c 100644 --- a/UI/volume-control.cpp +++ b/UI/volume-control.cpp @@ -733,18 +733,11 @@ void VolumeMeter::paintMeter(QPainter &painter, int x, int y, backgroundErrorColor); } else { + qreal end = errorLength + warningLength + nominalLength; painter.fillRect( minimumPosition, y, - nominalLength, height, - foregroundNominalColor); - painter.fillRect( - warningPosition, y, - warningLength, height, - foregroundWarningColor); - painter.fillRect( - errorPosition, y, - errorLength, height, - foregroundErrorColor); + end, height, + QBrush(foregroundErrorColor)); } if (peakHoldPosition - 3 < minimumPosition) {