mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-19 09:41:32 +08:00
libobs, UI: Add true peak measurements
Add a new algorithm to calculate the true-peak. It implements the Whittaker- Shannon interpolation from four samples to create 4 intermediate samples (5 x oversampling) inbetween the middle two samples. With 4 samples and 4 intermediate samples the algorithm can be implemented as a 4x4 vector-matrix cross product, which is ideal for SSE. I've also replaced the sample-peak algorithm using SSE as well to improve performance. Closes obsproject/obs-studio#1189
This commit is contained in:
@@ -401,6 +401,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
HookWidget(ui->channelSetup, COMBO_CHANGED, AUDIO_RESTART);
|
||||
HookWidget(ui->sampleRate, COMBO_CHANGED, AUDIO_RESTART);
|
||||
HookWidget(ui->meterDecayRate, COMBO_CHANGED, AUDIO_CHANGED);
|
||||
HookWidget(ui->peakMeterType, COMBO_CHANGED, AUDIO_CHANGED);
|
||||
HookWidget(ui->desktopAudioDevice1, COMBO_CHANGED, AUDIO_CHANGED);
|
||||
HookWidget(ui->desktopAudioDevice2, COMBO_CHANGED, AUDIO_CHANGED);
|
||||
HookWidget(ui->auxAudioDevice1, COMBO_CHANGED, AUDIO_CHANGED);
|
||||
@@ -2124,6 +2125,8 @@ void OBSBasicSettings::LoadAudioSettings()
|
||||
"ChannelSetup");
|
||||
double meterDecayRate = config_get_double(main->Config(), "Audio",
|
||||
"MeterDecayRate");
|
||||
uint32_t peakMeterTypeIdx = config_get_uint(main->Config(), "Audio",
|
||||
"PeakMeterType");
|
||||
|
||||
loading = true;
|
||||
|
||||
@@ -2159,6 +2162,8 @@ void OBSBasicSettings::LoadAudioSettings()
|
||||
else
|
||||
ui->meterDecayRate->setCurrentIndex(0);
|
||||
|
||||
ui->peakMeterType->setCurrentIndex(peakMeterTypeIdx);
|
||||
|
||||
LoadAudioDevices();
|
||||
LoadAudioSources();
|
||||
|
||||
@@ -3113,6 +3118,14 @@ void OBSBasicSettings::SaveAudioSettings()
|
||||
main->UpdateVolumeControlsDecayRate();
|
||||
}
|
||||
|
||||
if (WidgetChanged(ui->peakMeterType)) {
|
||||
uint32_t peakMeterTypeIdx = ui->peakMeterType->currentIndex();
|
||||
config_set_uint(main->Config(), "Audio", "PeakMeterType",
|
||||
peakMeterTypeIdx);
|
||||
|
||||
main->UpdateVolumeControlsPeakMeterType();
|
||||
}
|
||||
|
||||
for (auto &audioSource : audioSources) {
|
||||
auto source = OBSGetStrongRef(get<0>(audioSource));
|
||||
if (!source)
|
||||
|
||||
Reference in New Issue
Block a user