Restart playing last stopped/finished item

Forums:

Hi,

mocp -G can resume paused item. Would be useful if MOC could restart playing stopped/finished item also.

Hmmm... MOC doesn't remember that it's played an audio once it's finished. The generalisation of your request would be for MOC to retain a list of audios played and be able to replay from any point.

Let's see how many votes we get for that.

I think this is useful and not at all difficult. Of course I'm not a programmer.
Here's a small script to "moc" the last place to play after closing:
***************************
#!/bin/bash
OPEN ()
{
mocp -S && mocp -p && mocp -P
n=0
while read line
do
i[n]=$line
n=$[n+1]
done < <(cat ~/.moc/mem)
echo ${i[0]};
echo ${i[1]};

f=`mocp --format=%file`
while [ "$f" != "${i[0]}" ]
do
mocp -f && mocp -P && f=`mocp --format=%file`
done

mocp -U && mocp --seek=${i[1]} && gnome-terminal -e mocp;

exit 0
}
CLOSE ()
{
mocp --format=%file\\n%cs > ~/.moc/mem;
mocp -x;

exit 0
}
if (! pidof mocp );
then OPEN;
else CLOSE;
fi
************************************

He put it on the hot key.
If there are a lot of files in the playlist, then it is looking for a long time. Just wait a little.
It would be cool if at least there was a command "-p" by skipping on the track number in the playlist. Then it would be loaded instantly.
But all this is called a crutch.
But your "moc" I really liked.

It's perhaps an temporary solution to a subset of the requirement, but my understanding that the "replay" functionality was to act on an already running MOC server rather than continually bouncing it.

Also, I think the use of pidof(8) is problematic; the server's PID is available in ~/.moc/pid and kill -0 can be used to test whether it's still running (in the event that it didn't terminate cleanly and remove that file).

Thank you. I'll try it. )

Id like to see this also

Id like to see this also and resumed last place in the record