Features request

First of all i really like moc.
I'm switching from musicpd cause it can only play file indexed in his own database.

I use the cmdline interface.
#1 I' can't find a way to know the state of controls (shuffle,repeat,autonext).
I think it could be added in the info option (mocp -i).
in file interface.c in function interface_cmdline_file_info with something like this:

curr_file.state = get_state ();

printf("State: ");
if (curr_file.state == STATE_STOP) printf("STOP");
else if (curr_file.state == STATE_PLAY) printf("PLAY");
else if (curr_file.state == STATE_PAUSE) printf("PAUSE");

char* opts [] = { "Shuffle", "Repeat", "AutoNext" } ;
for ( i = 0; i < 3; ++i)
{
send_int_to_srv (CMD_GET_OPTION);
send_str_to_srv (opts[i]);
if ( get_data_int () )
printf(" - %s", opts[i]);
}
printf("\n");

if (curr_file.state != STATE_STOP)
{

....

So, for example, instead of
State: PLAY
i get
State: PLAY - Shuffle - Autonext

#2 I can't connect to server from a different user.
user1:/$mocp -M commondir -S
user2:/$mocp -M commondir -p

don't work cause only user1 has write permission on the created socket file.
I added:
umask(0);
at the beginning of the program in main.c and it works, but there should be a smarter solution.

#3 I ripped my cd collection and often i would like to play directly a track without using next/prev commands. So it would be nice if in play option (mocp -p) would be possible to select which track to play (es. mocp -p 4).

Thanks!
Fulvio Benini

You can do this by creating a

You can do this by creating a user/group for moc, call them moc. Make sure that all users using moc have the same MOCDir defined in .moc/config, that they have read/write access to that directory, and that they are members of the group moc. Run the server as the user moc, group moc, then 'chmod g+rw pid socket*'. Now whenever anyone runs the moc client, they will control the same server. This is similar operationally to the way Fulvio did it, but doesn't make me worry as much about privilege escalation as his method.

We use one computer this way in my office to play music off of, so my office mate and I don't have to swap around cabling and can control the music from our laptops wirelessly.

Your propositions for -i and

Your propositions for -i and -p seem simple, I think I'll do that.

About socket: MOC wasn't created as a "multiuser" server, not even talking about security, there could be problems with such configuration, it was never tested.

--
Damian Pietras - MOC developer

Thanks a lot!

Thanks a lot!