Increase volume meter scale from -100 to 0 dB

This was done to enable users to to use higher precision values in the
"Audio" condition type.
Previously, the UI would reset the selected values to the minimum value
possible to display in the volume meter widget, which was -60 dB.
This commit is contained in:
WarmUpTill 2024-09-19 20:52:01 +02:00 committed by WarmUpTill
parent 6ccbaad41c
commit 2f54c2ee62
2 changed files with 3 additions and 3 deletions

View File

@ -619,7 +619,7 @@ VolumeMeter::VolumeMeter(QWidget *parent, obs_volmeter_t *obs_volmeter,
magnitudeColor.setRgb(0x00, 0x00, 0x00); // Black
majorTickColor.setRgb(0xff, 0xff, 0xff); // Black
minorTickColor.setRgb(0xcc, 0xcc, 0xcc); // Black
minimumLevel = -60.0; // -60 dB
minimumLevel = -100.0; // -100 dB
warningLevel = -20.0; // -20 dB
errorLevel = -9.0; // -9 dB
clipLevel = -0.5; // -0.5 dB

View File

@ -657,7 +657,7 @@ void MacroConditionAudioEdit::SyncSliderAndValueSelection(bool sliderMoved)
if (sliderMoved) {
auto sliderPosition = _volMeter->GetSlider()->DoubleValue();
// Adjust to the dB scale on the volume meter widget
auto dBScaleValue = ((sliderPosition * 3.0) / 5.0) - 60.0;
auto dBScaleValue = sliderPosition - 100.0;
if (_entryData->_useDb) {
_volumeDB->SetFixedValue(dBScaleValue);
@ -677,7 +677,7 @@ void MacroConditionAudioEdit::SyncSliderAndValueSelection(bool sliderMoved)
? _entryData->_volumeDB.GetFixedValue()
: PercentToDecibel(_entryData->_volumePercent /
100.0);
auto sliderPosition = (dBValue + 60.0) * 5 / 3.0;
auto sliderPosition = (dBValue + 100);
_volMeter->GetSlider()->SetDoubleVal(sliderPosition);
}
}