By scanning through the updates row-by-row rather than column-by-column,
a lot of color-changing updates are saved when using a gradient. This
seems to significantly reduce tearing when running Cava through urxvt on
an X11 server.
This commit is split up in two parts.
First, usage of DEBUG is remapped to NDEBUG, such that the behaviour of
assert(3) is as expected with --enable-debug=false (i.e. asserts get
disabled, where they previously did not).
Second, instances of `printf` guarded by `#ifdef DEBUG` blocks have been
refactored into a dedicated `debug` macro to make the code a bit easier
to follow. `debug` is a no-op when `NDEBUG` is set.
`printf` and friends need to do work to parse the "%d" format string
during each call to `mvprintw`, and then more work to convert a
possibly-variable-length integer to a string.
Since we know that 0 <= `f[bar]` % 8 < 8, we can perform the character
conversion ourselves, saving some CPU time (and battery).
Refs #275.
While it was mentioned that the ability to acquire this information from MPD
would be useful, allowing it to be configured explicitly could be allow FIFO
to be used for non-MPD sources as well.
this commit involves some major and perhaps braking changes
audio sorting is now done by a common function in fifo.c
all other input plugins send a s16le interleaved audio buffer here,
reformating might be done here in the future.
Audio is put in to three buffers of different lenght, shorter
buffers for higher frequencies. FFT is aplied separetly and
the ouput is combined toghether in the separate_freq_bans function.
This creates better responsivnes for higher frequencies while still
beeing able to pick up the lower ones.