For the "ignore wheel" widgets, do not leave focus on mouse leave
events. This causes unintended side effects such as not being able to
type in edit boxes, and is very annoying.
This commit fixes the issue of being able to scroll through the mixer
with the mouse wheel without modifying the volume slider. This
functionality can be temporarily restored by holding a click on the
volume meter.
A mono input with surround output is upmixed by swresampler by routing
it to FC (front center) by default which corresponds to third channel
for 3.0, 4.0, 4.1, 5.0, 5.1, 7.1. (The other channels are muted.)
But the volume meters are set to show the first channel for mono sources.
Therefore although audio is processed, it would not show on the meter.
This fixes this display issue.
Closesobsproject/obs-studio#1540
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.
Closesobsproject/obs-studio#1189
Audio controls in OBS Mixer and Advanced Audio Properties window are not
sorted at all. Every time OBS is restarted they get shuffled (Jim note:
This is due to json object hashing). The order of these controls is
additionally not consistent between the mixer and the advanced audio
properties window.
Closesobsproject/obs-studio#1242
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)
Closesjp9000/obs-studio#1143
Before the new volume meters were implemented, the meter would flash red
if the audio was clipping. This functionality was removed when the
meters were changed, whether intentionally or unintentionally, and this
patch puts that functionality back in. If clipping occurs, the meters
will be fully colored with the foregroundErrorColor value while the
clipping is occurring.
The following features have been added to the audio-meters:
* Stereo PPM-level meter, with 40 dB/1.7s decay rate.
* Stereo VU-level meter, with 300 ms integration time.
* Stereo Peak-hold meter, with 20 second sustain.
* Input peak level color-squares in front of every meter.
* Minor-ticks for each dB.
* Major-ticks for every 5 dB.
* Meter is divided in sections at -20 dB and -9 dB.
The ballistic parameters chosen here where taken from:
* https://en.wikipedia.org/wiki/Peak_programme_meter (SMPTE RP.0155)
* https://en.wikipedia.org/wiki/VU_meter
In the rework I have removed any ballistic calculations from
libobs/obs-audio-controls.c making the calculations here a lot more
simple doing only MAX and RMS calculations for only the samples in
the current update. The actual ballistics are now done by just
the UI/volume-control.cpp because ballistics need to be updated
based on the repaint-rate of the user-interface.
The dB to pixel conversion has been moved from
libobs/obs-audio-controls.c to UI/volume-control.cpp as well to reduce
coupling between these two objects, especially when implementing the
major- and minor-ticks and the sections.
All colors and ballistic parameters are adjustable via QT style sheets.
There are slight differences in colors for each of the themes.
With the addition of the peak volume indicator, themes may wish to change
these colors but there was no way to do so. This change updates the
VolumeControl widget to allow a stylesheet to adjust all possible colors
for the volume bar. In addtion, the Rachni theme is updated to demonstrate
this new capability.
When the OBS signal is triggered for these widgets, the invokeMethod
could cause the thread to stall, which could make it wait much longer
than necessary to output audio data. When that happens, it causes audio
monitoring to get backed up and get unnecessarily delayed, as well as
cause general audio buffering in libobs to increase unnecessarily.
A simple fix both in terms of preventing that stall and improving UI
performance is to not call invokeMethod to update the widget each time,
and then instead have those widgets update themselves via a timer at a
specific interval.