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.
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
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).
jcf
Sun, 2016-07-03 20:35
Permalink
Generalised Replay
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.
deribas
Fri, 2017-04-14 06:27
Permalink
I think this is useful and
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.
jcf
Fri, 2017-04-14 08:56
Permalink
Thanks
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
andkill -0
can be used to test whether it's still running (in the event that it didn't terminate cleanly and remove that file).deribas
Fri, 2017-04-14 20:03
Permalink
Thank you. I'll try it. )
Thank you. I'll try it. )
knob
Sun, 2016-12-25 18:51
Permalink
Id like to see this also
Id like to see this also
deribas
Thu, 2017-04-13 06:27
Permalink
Id like to see this also and
Id like to see this also and resumed last place in the record