libmpdclient retrieve full paths

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...
Post Reply
Bigfoot
Posts: 4
Joined: May 6th, 2016, 2:56 pm

libmpdclient retrieve full paths

Post by Bigfoot »

Hello,

I am currently developing a new project using the libmpdclient library. I am desperately trying to retrieve the full/absolute paths of the playing song or the mpd music directory. Until now I was only able to retrieve the relative path.

Thank you very much for any answer :)

max
Forum team
Posts: 1024
Joined: January 15th, 2013, 3:43 pm

Re: libmpdclient retrieve full paths

Post by max »

MPD doesn't send absolute paths for files within the music directory, so libmpdclient can't give them to you.

What you can do is read the music_directory configuration from the "config" command.

Bigfoot
Posts: 4
Joined: May 6th, 2016, 2:56 pm

Re: libmpdclient retrieve full paths

Post by Bigfoot »

Thank you very much :)

Bigfoot
Posts: 4
Joined: May 6th, 2016, 2:56 pm

Re: libmpdclient retrieve full paths

Post by Bigfoot »

Hello,

So after looking at what you advised, I found this page. It absolutely looks like what I am interested in, but unfortunately, after send the command, the received pair doesn't return anything. Other commands work, such as commands which returns all the available commands and the config command is in it.

So if anyone has any idea please let me know and thank you in advance for any response :)

max
Forum team
Posts: 1024
Joined: January 15th, 2013, 3:43 pm

Re: libmpdclient retrieve full paths

Post by max »

What socket address did you connect to?

Bigfoot
Posts: 4
Joined: May 6th, 2016, 2:56 pm

Re: libmpdclient retrieve full paths

Post by Bigfoot »

Thank you for your quick answer :D

I connected to the mpd server using this piece of code:

Code: Select all

mpd_connection_new(NULL, 0, 30000)
Since I in the mpd.conf config file I used the default port and host (localhost and port 6600) I thought this was okay.

Thank you again very much for any response :)

max
Forum team
Posts: 1024
Joined: January 15th, 2013, 3:43 pm

Re: libmpdclient retrieve full paths

Post by max »

Now look at the documentation. What precondition does it mention for being able to query this piece of information?

Ran
Posts: 151
Joined: February 25th, 2013, 3:47 am

Re: libmpdclient retrieve full paths

Post by Ran »

Bigfoot wrote:Thank you for your quick answer :D

I connected to the mpd server using this piece of code:

Code: Select all

mpd_connection_new(NULL, 0, 30000)
Since I in the mpd.conf config file I used the default port and host (localhost and port 6600) I thought this was okay.

Thank you again very much for any response :)
"This command is only permitted to "local" clients (connected via UNIX domain socket)"

Post Reply