by bastienauneau » 24 Feb 2015, 01:49
I still think using mpc is a good alternative :
mpc stats (for what's playing)
mpc idleloop (to catch events)
is a better option, because :
_ it's portable/outside runeaudio, so you wont have to apply your patch every time you update rune audio. And what if one day, there's such a change that you need to re-design your patch ?
_ it's more simple, so easier to maintain
_ in both case (using mpc or calling the python script), you start a new process. Eventhough there's an extra process listenning to idleloop (I guess), what's expensive is creating a process
Also, having an extra daemon to do the screen is nothing wrong, I would say : it's the way to go. Not talking here about adding ten's of daemons, just one, doing a simple job, but doing it well (namely printing whatever status on the screen)
Finally, you're killing a process at every message, which doesn't look wise to me. Usually, you never need to kill a process, or else you've done a bad design choice earlier
If you want to stick on adding an extra line in runeaudio code to forward the message to your python script. I would suggest using a socket, pipe or file interface
This would allow you to catch message reading the socket/pipe/file with your python script