|
|
@@ -653,6 +653,13 @@ void VolumeMeter::paintTicks(QPainter &painter, int x, int y,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+#define CLIP_FLASH_DURATION_MS 1000
|
|
|
+
|
|
|
+void VolumeMeter::ClipEnding()
|
|
|
+{
|
|
|
+ clipping = false;
|
|
|
+}
|
|
|
+
|
|
|
void VolumeMeter::paintMeter(QPainter &painter, int x, int y,
|
|
|
int width, int height, float magnitude, float peak, float peakHold)
|
|
|
{
|
|
|
@@ -672,6 +679,10 @@ void VolumeMeter::paintMeter(QPainter &painter, int x, int y,
|
|
|
int errorLength = maximumPosition - errorPosition;
|
|
|
locker.unlock();
|
|
|
|
|
|
+ if (clipping) {
|
|
|
+ peakPosition = maximumPosition;
|
|
|
+ }
|
|
|
+
|
|
|
if (peakPosition < minimumPosition) {
|
|
|
painter.fillRect(
|
|
|
minimumPosition, y,
|
|
|
@@ -740,6 +751,12 @@ void VolumeMeter::paintMeter(QPainter &painter, int x, int y,
|
|
|
backgroundErrorColor);
|
|
|
|
|
|
} else {
|
|
|
+ if (!clipping) {
|
|
|
+ QTimer::singleShot(CLIP_FLASH_DURATION_MS, this,
|
|
|
+ SLOT(ClipEnding()));
|
|
|
+ clipping = true;
|
|
|
+ }
|
|
|
+
|
|
|
qreal end = errorLength + warningLength + nominalLength;
|
|
|
painter.fillRect(
|
|
|
minimumPosition, y,
|