D
D
dlinyj2016-06-12 16:35:03
linux
dlinyj, 2016-06-12 16:35:03

Where can I find examples of the simplest mpd client in C?

I am writing my application in C for mpd. And you need to receive data about the melody being played, as well as give commands to move to a given position. Now I'm implementing it through an external call to mpc. But it's kind of a bad idea.
I would like some simple example with sockets for working with mpd. I tinkered with mpc and mpclib with a stick , it was too monstrous for my tasks.
I poked with telnet, everything seems to be simple:

$ telnet localhost 6600
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
OK MPD 0.18.0
play 13
OK
currentsong
file: http://rts.ipradio.rs:8006
Name: Radio Beograd 202
Pos: 13
Id: 14
OK
play 4
OK
currentsong
file: http://us-tx1.streams.bassdrive.com:9000/
Title: The Warm Ears Show hosted by Elementrix - special guest Radicall
Name: Bassdrive - Worldwide Drum and Bass Radio
Pos: 5
Id: 6
OK
status
...
playlistlength: 14
...
song: 5
songid: 6
...
nextsong: 6
nextsongid: 7
OK

Earlier, somewhere on the net, I met the simplest example of working with mpd via sockets, but now I can’t google it. Maybe someone will tell? All the best was invented for us, we just want to apply a ready-made solution for ourselves. If I don't find it, I'll write it myself. Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
Human, 2016-06-13
of Humans @tenhi_shadow

The best client is without a doubt ncmpc.
I somehow set up a web interface for mpd (I was in arch rep)

D
dlinyj, 2016-06-15
@dlinyj

Duc, I do not need a client, but an example of work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question