MPD: reading a stop command from a named pipe

Discuss client development (or even MPD development if you feel so inclined), ask questions about the client libs, MPD feature requests from client developers, etc...

MPD: reading a stop command from a named pipe

Postby edmcm » August 9th, 2017, 8:07 pm

I am trying to send a STOP command to MPD, using a named pipe FiFo. I will create the pipe in a second application and write into FIFO in that application. I would then like to read the FiFo from within MPD.

When MPD reads a STOP command from Fifo, I would like it to behave as if the PlayerCommand::STOP was just received from a client.

I believe I want to find the spot in the code where MPD is waiting for client commands. I would then insert the extra code to check FIFO content as well, and act accordingly.

Any advice on locating the best spot to place the FIFO read code, would be appreciated.

Thanks,
Ed
edmcm
 
Posts: 2
Joined: August 5th, 2017, 3:14 pm

Re: MPD: reading a stop command from a named pipe

Postby max » August 11th, 2017, 5:08 pm

I think you posted the same thing on the mailing list, and it turned out that MPD already has a way to receive stop commands: the regular socket protocol.
max
Forum team
 
Posts: 573
Joined: January 15th, 2013, 3:43 pm

Re: MPD: reading a stop command from a named pipe

Postby edmcm » August 14th, 2017, 7:33 pm

Max,

That is right thank-you. I will be using the local socket setup by MPD. Could you please advise on the filename/path to use for the MPD socket address? I've tried using Linux ss command to find it, but no luck.

Thanks,
Ed
edmcm
 
Posts: 2
Joined: August 5th, 2017, 3:14 pm

Re: MPD: reading a stop command from a named pipe

Postby max » August 15th, 2017, 7:17 am

It is the one you configured! Only you can know it.
max
Forum team
 
Posts: 573
Joined: January 15th, 2013, 3:43 pm


Return to Developers' Corner

Who is online

Users browsing this forum: No registered users and 2 guests