This is meant to exactly mimic the terminal UI, just without
the restriction to ugly monospace fonts.
The Curses implementation has been reworked, and may have become
more computationally expensive. In general, though, the codebase
has been significantly cleaned up.
I know, son, it might be hard to accept,
but you're imported. Your true parents are wmstatus
and paswitch, from the desktop-tools family.
Also, fix unnecessary linking of optional dependencies.
I was tired of using `mpv --no-video`, this is a bit better.
It's all rather quirky, but very little code is involved.
I've added a few related TODO entries.
Also, do not set up the spectrum visualiser before a password is sent.
It would look a bit weird to have it run but display "Disconnected",
even though technically, it would probably work.
Don't just abort() on failures, print a proper error message.
Also, set up ncurses as late as possible. This should be alright wrt.
signal handlers according to ncurses code, as well as XSI:
> Curses implementations may provide for special handling of
> the SIGINT, SIGQUIT and SIGTSTP signals if their disposition
> is SIG_DFL at the time initscr is called ...
termo blocks job control, so SIGTSTP is not a concern at all.
It is less distracting.
Also use mpd_read_time() and load "duration" as well.
This value isn't rounded to whole seconds, so we load
it before "time" as a fail-safe measure.
- reject negative values, which strtoul() happily accepts
- deal with an arbitrary number of decimal digits
- don't return milliseconds when we fail to parse seconds
Playback may sometimes stall but it won't produce any events.
This popular workaround likes to jump around, though.
It might be a good idea to use some kind of hybrid approach.
Therefore this is disabled by default so far.
Updates #1