From: Ken Hayber <ken@ha...> - 2006-02-19 00:28:04
I have been kicking around some ideas about the future of MusicBox.
One idea is to separate the UI from the player. The current player.py and plugins does not depend
on gtk or rox for anything, so this shouldn't be too hard.
Today I quickly added some code to run player.py as a python SocketServer which listens on a Unix
domain socket for simple string commands (e.g. 'play,some-song.mp3,audio/mpeg') and it works quite well.
The UI or any front-end only has to open a socket (/tmp/musicbox) and send some strings.
For example: to play a mp3
from socket import *
sk = socket(AF_UNIX, SOCK_DGRAM)
The concept is to start the player (server/daemon) on demand and keep it running, either forever, or
until some time has expired with nothing to do. The UI would connect to the socket and communicate
with it. If the server wasn't running the UI could offer to start one, or simply inform the user
what to do. The server could be started at boot or login time.
Multiple UIs could talk to the same server
The server would keep playing even if the UI or X died or exited normally.
There would be a new command to quit the server.
The server would write status back on the socket so the UI could see what was happening.
People could write their own UI (GUI or text) easily.
Using UDP sockets instead of Unix sockets would allow remote control/monitoring.
(but not streaming)
Any suggestions or comments (either technical or practical) on this idea before I go too far?
From: Lennon Cook <maguswizardo@gm...> - 2006-02-19 01:43:54
On 2/19/06, Ken Hayber <ken@...> wrote:
> Any suggestions or comments (either technical or practical) on this idea =
before I go too far?
MPD ( musicpd.org )already does alot, or possibly all, of this. It
also handles remote control/monitoring *and* streaming, if I
understand your point about sockets.
Maybe you could turn MusicBox into an MPD front-end?
Lennon Victor Cook
"He who receives an idea from me receives without lessening, as he who
lights his candle at mine receives light without darkening" - Thomas
From: Ken Hayber <ken@ha...> - 2006-02-19 02:28:06
Lennon Cook wrote:
> On 2/19/06, Ken Hayber <ken@...> wrote:
>> Any suggestions or comments (either technical or practical) on this idea before I go too far?
> MPD ( musicpd.org )already does alot, or possibly all, of this. It
> also handles remote control/monitoring *and* streaming, if I
> understand your point about sockets.
> Maybe you could turn MusicBox into an MPD front-end?
1) I have all this code already written you see. All I'm talking about doing is separating the UI
from the back-end. Not replacing the back-end. It looks like interfacing to MPD would be more work
than what I'm talking about.
2) They put the playlist in the server - I'm not sure that's the way I want to go just yet.
3) Reading the documentation on musicpd.org made the hair on the back of my neck stand up. :)
In general, I think having a standard (freedesktop.org?) for a Desktop Music Server interface would
be very nice. How to find the server, how to launch one if not already running, how to send
commands, how to get status, ...
Then people could mix and match front/back-ends at will.
I'd think a layered approach (basic, extended, kitchen-sink) to feature compatibility would be the
way to go.
That said, I might look into seeing if what I do could be compatible with MPD or not.
Thanks for the feedback.