diff --git a/UI/volume-control.cpp b/UI/volume-control.cpp index 0111858ab1671f..b82d9f4f90210e 100644 --- a/UI/volume-control.cpp +++ b/UI/volume-control.cpp @@ -856,7 +856,7 @@ VolumeMeter::VolumeMeter(QWidget *parent, obs_volmeter_t *obs_volmeter, minimumLevel = -60.0; // -60 dB warningLevel = -20.0; // -20 dB errorLevel = -9.0; // -9 dB - clipLevel = -0.5; // -0.5 dB + clipLevel = 0.0; // 0 dB minimumInputLevel = -50.0; // -50 dB peakDecayRate = 11.76; // 20 dB / 1.7 sec magnitudeIntegrationTime = 0.3; // 99% in 300 ms @@ -1191,7 +1191,7 @@ void VolumeMeter::paintHMeter(QPainter &painter, int x, int y, int width, peakPosition = maximumPosition; } - if (peakPosition < minimumPosition) { + if (peak < minimumLevel) { painter.fillRect(minimumPosition, y, nominalLength, height, muted ? backgroundNominalColorDisabled : backgroundNominalColor); @@ -1201,7 +1201,7 @@ void VolumeMeter::paintHMeter(QPainter &painter, int x, int y, int width, painter.fillRect(errorPosition, y, errorLength, height, muted ? backgroundErrorColorDisabled : backgroundErrorColor); - } else if (peakPosition < warningPosition) { + } else if (peak < warningLevel) { painter.fillRect(minimumPosition, y, peakPosition - minimumPosition, height, muted ? foregroundNominalColorDisabled @@ -1216,7 +1216,7 @@ void VolumeMeter::paintHMeter(QPainter &painter, int x, int y, int width, painter.fillRect(errorPosition, y, errorLength, height, muted ? backgroundErrorColorDisabled : backgroundErrorColor); - } else if (peakPosition < errorPosition) { + } else if (peak < errorLevel) { painter.fillRect(minimumPosition, y, nominalLength, height, muted ? foregroundNominalColorDisabled : foregroundNominalColor); @@ -1231,7 +1231,7 @@ void VolumeMeter::paintHMeter(QPainter &painter, int x, int y, int width, painter.fillRect(errorPosition, y, errorLength, height, muted ? backgroundErrorColorDisabled : backgroundErrorColor); - } else if (peakPosition < maximumPosition) { + } else if (peak <= clipLevel) { painter.fillRect(minimumPosition, y, nominalLength, height, muted ? foregroundNominalColorDisabled : foregroundNominalColor); @@ -1246,7 +1246,7 @@ void VolumeMeter::paintHMeter(QPainter &painter, int x, int y, int width, maximumPosition - peakPosition, height, muted ? backgroundErrorColorDisabled : backgroundErrorColor); - } else if (int(magnitude) != 0) { + } else { if (!clipping) { QTimer::singleShot(CLIP_FLASH_DURATION_MS, this, [&]() { clipping = false; }); @@ -1303,7 +1303,7 @@ void VolumeMeter::paintVMeter(QPainter &painter, int x, int y, int width, peakPosition = maximumPosition; } - if (peakPosition < minimumPosition) { + if (peak < minimumLevel) { painter.fillRect(x, minimumPosition, width, nominalLength, muted ? backgroundNominalColorDisabled : backgroundNominalColor); @@ -1313,7 +1313,7 @@ void VolumeMeter::paintVMeter(QPainter &painter, int x, int y, int width, painter.fillRect(x, errorPosition, width, errorLength, muted ? backgroundErrorColorDisabled : backgroundErrorColor); - } else if (peakPosition < warningPosition) { + } else if (peak < warningLevel) { painter.fillRect(x, minimumPosition, width, peakPosition - minimumPosition, muted ? foregroundNominalColorDisabled @@ -1328,7 +1328,7 @@ void VolumeMeter::paintVMeter(QPainter &painter, int x, int y, int width, painter.fillRect(x, errorPosition, width, errorLength, muted ? backgroundErrorColorDisabled : backgroundErrorColor); - } else if (peakPosition < errorPosition) { + } else if (peak < errorLevel) { painter.fillRect(x, minimumPosition, width, nominalLength, muted ? foregroundNominalColorDisabled : foregroundNominalColor); @@ -1343,7 +1343,7 @@ void VolumeMeter::paintVMeter(QPainter &painter, int x, int y, int width, painter.fillRect(x, errorPosition, width, errorLength, muted ? backgroundErrorColorDisabled : backgroundErrorColor); - } else if (peakPosition < maximumPosition) { + } else if (peak <= clipLevel) { painter.fillRect(x, minimumPosition, width, nominalLength, muted ? foregroundNominalColorDisabled : foregroundNominalColor);