Commit Briefs
add consume mode
the consume mode implicitly drops the tracks from the playlist when played 'till the end (note that skipping over a track doesn't trigger the consume mode - yet?)
monitor: fix reported event
rethink a bit which event are reported and when. - drop 'toggle' event as it's not useful; now 'amused toggle' will report the play/pause event. - replace 'flush' with 'load'. there's no real difference between a flush and an empty load. (also, less event the better) - some events (next/prev/jump) are reported earlier to avoid possible issues (when messing around with the playing queue we can end up in every possible state.) - report 'seek' only after it really happened (i.e. after the player process sent the new position.) There's still a possible race here (we can receive a previous IMSG_POS and think it's the reply to the seek) but it it's hard/impossible to work around. - drop 'restart'. we have 'seek' now which is better (and actually restart is implemented on top of seek.) - add 'seek' to the default list of events.
refactor control_notify
it's awkward to call it with the address of the imsgev struct inside the ctl_conn struct. Just relay the info to every client in monitor mode. After all, if a client is in monitor mode *and* issues commands, it's not strange that they're echoed back (note that this is currently impossible, the command line client can either issue commands or be in monitor mode.)
use (a modified version of) kristaps' oconfigure
see GitHub issue #1
implement seeking
This adds the internal management of the seeking, as well as the decoder backends bits.
improving error reporting
makes the player process optionally send back a string describing the failure to provide a better and more coincise error message. This turns the syslog message(s): amused: unknown file type amused: failed to play, skipping /home/op/pics/phos.jpg into: amused: unknown file type; skipping /home/op/pics/phos.jpg
skip every non-regular file
not only directories... I guess we can't do much even with sockets, fifos or character devices. (symbolic links are still supported since we follow them)
avoid unnecessary initialization
we're just gonna memcpy all over path again a couple of lines before; a smart compiler will probably ignore the initialization anyway.
don't send the song' path to the player process
we're not relying anymore on the file extension, so this information is useless for the player.
reuse main_send_player
instead of filling the params for imsg_compose_event.