You are not logged in.

#1 2011-06-14 21:32:42

grine
Member
Registered: 2010-02-09
Posts: 38

MPD and queueing

Hello, I'm looking for an mpd-client which will allow queueing like in foobar2k, winamp or the Spotify client.

All I can find is mpd devz saying: "Should be implemented in client" and client devz saying: "Should be implemented in mpd"

I'm currently using ncmpcpp and I like it except for this missing feature, does anyone have any help to give on this?

Offline

#2 2011-06-14 22:00:55

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: MPD and queueing

I once wrote something that will play a song that is in your current playlist and then continue with where you were when it's done.
I wrote it quite a while ago, and it may need some fine-tuning.
Depending on what other features you want, I could update it. I really hate what the MPD devs did to 0.16 though, I'm sticking with the 0.15 branch, so mpd.db will be different (for searching songs outside of your current playlist).  Maybe mpc can do that though...

#! /bin/bash
[ $# = 0 ] && exit
mpdstate=~/.mpd/mpdstate
currentsong=$(mpc | sed -n '2s/.*#\([0-9]*\).*/\1/p')
currentseek=$(mpc | sed -n '2s/.*(\([0-9]*%\))/\1/p')
search=$({ echo search any $(echo $* | sed 's/ / any /g'); echo close; } | nc localhost 6600 | grep ^file | cut -d' ' -f2-)
lines=$(echo "$search" | wc -l)
[ $lines = 0 ] && exit
if [ $lines -gt 1 ]; then
    if tty > /dev/null; then
    IFS="
"
    select line in $search; do search=$line; break; done
    [ -z "$REPLY" ] && exit
    else
    search=$(echo "$search" | dmenuwrap)
    [ -z "$search" ] && exit
    fi
fi
mpc play $(( $(grep -F "$search" $mpdstate | cut -d':' -f1) + 1 )) > /dev/null # mpdstate is 0-based 
while mpc idle > /dev/null; do
mpc --format '%file%' | grep -q -F "$search" || break # don't play previous song if you are just pausing the player or repeating the track
done
mpc play $currentsong > /dev/null
mpc seek $currentseek > /dev/null

Offline

#3 2011-06-14 22:03:47

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: MPD and queueing

Try GMPC.  I believe it has a plug-in for this.

Offline

Board footer

Powered by FluxBB