mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-07-19 19:55:16 -04:00
UI: Add audio meter decay rate option
The decay rate of the audio meters can now be selected in the audio settings. The values are: - "Fast" (OBS default, 40 dB / 1.7s) - "Medium" (Type I PPM, 20 dB / 1.7s) - "Slow" (Type II PPM, 24 dB / 2.8s) Closes jp9000/obs-studio#1143
This commit is contained in:
@@ -400,6 +400,16 @@ void OBSBasic::copyActionsDynamicProperties()
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasic::UpdateVolumeControlsDecayRate()
|
||||
{
|
||||
double meterDecayRate = config_get_double(basicConfig, "Audio",
|
||||
"MeterDecayRate");
|
||||
|
||||
for (size_t i = 0; i < volumes.size(); i++) {
|
||||
volumes[i]->SetMeterDecayRate(meterDecayRate);
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasic::ClearVolumeControls()
|
||||
{
|
||||
VolControl *control;
|
||||
@@ -1235,6 +1245,8 @@ bool OBSBasic::InitBasicConfigDefaults()
|
||||
config_set_default_uint (basicConfig, "Audio", "SampleRate", 44100);
|
||||
config_set_default_string(basicConfig, "Audio", "ChannelSetup",
|
||||
"Stereo");
|
||||
config_set_default_double(basicConfig, "Audio", "MeterDecayRate",
|
||||
VOLUME_METER_DECAY_FAST);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2549,6 +2561,9 @@ void OBSBasic::ActivateAudioSource(OBSSource source)
|
||||
|
||||
VolControl *vol = new VolControl(source, true);
|
||||
|
||||
double meterDecayRate = config_get_double(basicConfig, "Audio",
|
||||
"MeterDecayRate");
|
||||
vol->SetMeterDecayRate(meterDecayRate);
|
||||
vol->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
connect(vol, &QWidget::customContextMenuRequested,
|
||||
|
||||
Reference in New Issue
Block a user