I want to write a new client - for mpd

387 views
Skip to first unread message

mattip

unread,
Jun 12, 2010, 4:30:35 PM6/12/10
to imms-users
Rather than a plugin, the mpd client would have to be a stand-alone
executable that listens to the mpd server and reacts when the playlist
changes.

I am a capable programmer, I took a look at the xmms client code, and
would appreciate hints of the best way to proceed.

Matti

Dave Schaefer

unread,
Jun 14, 2010, 11:33:10 PM6/14/10
to mattip, imms-users
Hey Matti,

Thanks for the interest - more work on an MPD client would be great.

>> Rather than a plugin, the mpd client would have to be a stand-alone
>> executable that listens to the mpd server and reacts when the playlist
>> changes.

I have not read through all of the source code yet but I believe this
should be doable with IMMS. The main component of IMMS is the immsd
process, which reads and writes from the IMMS databases to modify song
stats and recommend songs. Usually plugins work by connecting to the
immsd socket and reading and writing commands. As long as your MPD
client connects to the socket and sends the right commands I think
that should work just fine (anyone feel free to correct me if I'm
wrong).

immsd creates its socket in ~/.imms/socket . If you look in the code
under immsd/immsd.cc you can see some of the commands that need to be
sent - you start by passing the string "IMMS", and then send the
different strings inside ImmsProcessor::process_line() as appropriate.
The plugins in the clients/ folder ( or Joel's plugin at
http://ril.endoftheinternet.org/%7Ejojkaart/imms-quodlibet/ ) might
serve as examples of how and when to send commands.


Does that help? Are you looking for more technical info? I am learning
how to write an IMMS client myself, and I'd like to write a primer on
what is needed to create a client or plugin, but I'm still figuring
out how everything works so I haven't written much yet.


I believe Hans and Von Fugal and Stark3000 were all working on MPD
plugins or clients at one point. Maybe one of them would be able to
help? Are any of you three still on this mailing list?


Let us know if that's what you need, or what else you're looking for.
Dave

Joel Joonatan Kaartinen

unread,
Jun 16, 2010, 5:53:30 AM6/16/10
to Dave Schaefer, mattip, imms-users
Hi Dave, Matti,

If you don't mind coding in Python, you should be able to use some 80%
of my imms plugin code for your MPD client.

The code for interacting with immsd is separated into a separate class
from the one that interacts with Quod Libet. It's also documented quite
completely. I'm also willing to help you with the code if you have
questions about it.

So, effectively, you'd mostly only need to deal with writing the part
that interacts with MPD server.

- Joel

--
Joel Joonatan Kaartinen <jkaar...@iki.fi>

Matti Picus

unread,
Jun 16, 2010, 10:54:53 AM6/16/10
to imms-users
Thanks, python is good, reuse is good, and the class looks pretty easy
to use.
I'll get back when I have something to show.

Matti

Michael Grigoriev

unread,
Jun 19, 2010, 5:25:49 PM6/19/10
to matti...@gmail.com, imms-users
Alternatively, if you want to use C++, just use the Imms object (immscore/imms.h) directly.
The interface is a little weird (you have to pump events and inject the playlist externally), but you should be able to figure out how it works by looking at what immsd does.

Have fun,
Michael.

--
You received this message because you are subscribed to the Google Groups "imms-users" group.
To post to this group, send email to imms-...@googlegroups.com.
To unsubscribe from this group, send email to imms-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/imms-users?hl=en.


Reply all
Reply to author
Forward
0 new messages