Change the auto-gain stopping criterion to be on corrected LU.
This might be less safe (there might be some feedback effects involved),
but the behavior of working on _uncorrected_ LU was simply too unintuitive;
it was hard to understand why the setting wasn't moving.
Actually this is mostly because I like being able to press the
mute button on my MIDI controller and have it light up :-)
Internally, it's implemented by forcing the volume to zero
(or sometimes -90 dB), which means we get all the nice
fading properties and such.
In the process, we now declare -90 dB to be truly zero, and don't
bother adding it to the bus.
It's unlikely that there will be lots of real MIDI note data going on
in the system, so just slurping up all of it seems reasonable
(it's certainly the most user-friendly).
Seemingly we can get multiple events in one poll, and we can _not_
just go back to polling again (the poll will hang). I consider this
an ALSA bug, but it's easy to work around, the same way aseqdump
does; just set the sequencer to nonblocking and loop over it
until we get EAGAIN.
Add support for controlling the audio using a MIDI controller.
This allows the user to control the audio using a dedicated controller,
as opposed to the mouse, which generally is a more direct and intuitive
user interface.
This is rather raw at the moment (e.g., hardcoded MIDI address, no real UI
indications of bank switches, and no UI for editing the mapping), but the
required basics are generally in place.
Make NonlinearFader work with fixed 0..1000 range, not 0..height().
In particular, this fixes an issue where the range could be wrong
just after the widget is created, but the page it is not is not shown
yet (so there hasn't been a resize event yet).
Also makes for more consistent scroll wheel and arrow key behavior,
as it is not longer dependent on widget size.
Now that most of the multichannel work has been done, we can put the
wraps back on and reenable the simple audio model from 1.3.x, which is
less flexible but also easier for the casual user. Users can choose
between the old model (simple) and the new (multichannel) through a
UI toggle, or with a command-line flag; they map to the same processing
code.
Let settings follow buses when editing the mapping.
If a user wants to add a new bus (or delete one), we shouldn't
delete all their settings. Track them as a nicely bound-together
hidden state when editing. (This also lays the ground for
serialization of the entire mixer state in the future,
should we want to do that.)
Settings these up can be a bit of a hassle if you have a lot of them,
so we allow them to be saved to disk and then loaded back (complete
with machinery for fuzzy-matching devices if the state has changed,
e.g. cards moved around).
This introduces a dependency on protocol buffers, because it's a
convenient way to store simple data to disk (including forward
compatibility). We choose to use the text format for the user's
convenience; we don't need the speed or compactness of the binary format.
If a dead device comes back, put it into the right slot.
This fulfills one of the basic goals of hotplug, namely that a sound
card can disappear (ie., lost cable), be replugged and then safely
come back without any manual intervention.
Instead of exit(1) whenever something in ALSA initialization fails,
we now return false and try again after a second. (This means we could
potentially be doing init for a long time, so it is moved to the
capture thread.)
We don't support removing cards yet (we still just exit on error),
and thus also not replacing dead cards with re-plugged ones.
We also don't communicate changed state to the UI yet, and retry
could still be improved.
In particular, all the inputs are not owned by a class ALSAPool,
which also takes over enumeration. There's a new state machine
(only in preparation, not actually used yet), and some policy
has been defined for what to do when cards go in and out.
This version supports not only two channels, but mono, stereo or
multiples of four. (In time, we might reorganize so that
e.g. 11 channels are split into 8-, 2- and 1-channel resamplers.)
When the fader is moved, interpolate its volume over the next frame.
Faders are among the things one should definitely be allowed to move
around during an actual mix without hearing clicking; the gain and threshold
is maybe somewhat less so, so I won't give it the same treatment, at least not
right now.
Replace the R128 meters for each channel with a digital peak meter.
R128 is a superior way of measuring loudness, but for each bus, we care more
about getting the recording levels right (ie., that we don't peak) than loudness.
Since we do our mixing in float, unlike a typical digital mixer, it's not as
critical (at least assuming that the limiter is on and will save us later in
the mastering chain), but it's probably better to be consistent with convention
here.
Thus, use a simple digital meter for each bus, even though we of course still
use R128 for the mastering section.
This allows us to switch between compact and full audio layout.
The full audio layout is not really populated yet; there are only
some widgets (a subset of the compact ones), and they are not
hooked up.
Add support for ALSA devices that have no channel maps.
In particular, my Focusrite Scarlett 18i6 presents no such map,
and thus, we'll need to get number of channels some other way.
(For good measure, it refuses to capture unless you ask for at least
14 of the 18 channels.)