2 Why Another MPD Client Library?

elmpd was borne of experimentation with the other client packages listed above; as I fine-tuned my workflow, I found myself wanting less functionality: rather than interacting with a fully-featured client, I just wanted to skip to the next song while I was editing code with a quick key chord, for example. I customize my mode line heavily, and I wanted just a little bit of logic to add the current track to the mode line & keep it up-to-date as MPD progressed through the playlist. I have written a companion daemon to MPD that maintains ratings & play counts; I just needed a little function that would let me rate the current track while I was, say, reading mail.

My next move was to read through a number of client libraries for inspiration, both in C & Emacs Lisp. Many of them had strong opinions on how one should talk to MPD. Having been programming MPD for a while I had come to appreciate its simplicity (after all, one can program it from bash by simply echoing commands to /dev/tcp/$host/$port). My experience with async Rust inspired me to see how simple I could make this. Each elmpd connection consumes a socket & optionally a callback– that’s it (no buffer, no transaction queue). Put another way, if other libraries are Gnus (featureful, encourages you to read your e-mail in a certain way), then elmpd is Mailutils (small utilities that leave it up to the user to assemble them into something useful).