Browse Source

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.
jp9000 8 years ago
parent
commit
17d2a17f9e
1 changed files with 3 additions and 10 deletions
  1. 3 10
      UI/volume-control.cpp

+ 3 - 10
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) {