The reworked noncurses mode uses a custom framebuffer technique that
only draws changes per frame and only writes to the terminal once per
frame. This results in far less cpu usage then ncurses. It is also
free of the flickering that we se in ncurses mode #196
Colors are no longer set by default so hopefully cava will change
color automatically in noncurses mode when using tools such as
pywall #340#181
Unfortunently html colors, gradient and key controls are not supported
in noncurses.
a new line after last row caused the terminal to start scrolling
this was resolved in the past by simply not drawing that row.
new fix is to not newline at the last row, but do a return instead
the code has up until now used shorthand var names such as bw
for bar width and lcf for lower cut-off frequency. There is no
need for this. We are now moving to a naming scheme of
descriptive names on two to three words using underscores.
when setting background color manually there was some strange bug
offsetting the bars and adding characters that are not cleaned up,
memory issue in ncurses?
fixed by adding spaces all over screen on init to paint background
manually.
this way we will not temper with the color definitions mostly
used in the terminal. This resolves#336. Also removed the reset
that was suposed to fix the, but did nothing, closes#305.
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.
`setterm` can fail, in which case cava exits with something like:
> setterm: terminal rxvt-unicode-256color does not support --blank
This commit silences the potential error.
`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).
Now, the option to configure gradient with more than 2 colors is
supported. To use this, write the following in your config :
gradient = 1
gradient_count = <num>
gradient_color_1 = <col>
gradient_color_2 = <col>
gradient_color_3 = <col>
.
.
.
gradient_color_<num> = <col>
Replace <num> with the number of colors (2 <= colors <= 8), and replace
<col>s with your colors of choice. You must explicitly provide all
colors for the gradient to work, otherwise appropiate errors will be
shown.