mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 21:06:52 +03:00
5b81966b3e
* extfs/audio: Added a way to browse audio CDs conviently
38 lines
672 B
Bash
Executable File
38 lines
672 B
Bash
Executable File
#! /bin/sh
|
|
#
|
|
# Written by Pavel Machek
|
|
#
|
|
# (C) 2000 The Free Software Foundation.
|
|
#
|
|
# FIXME: it would be much nicer to use names like track-01.wav, like cdfs does.
|
|
#
|
|
|
|
audiofs_list ()
|
|
{
|
|
cdparanoia -Q -d $1 2>&1 | grep '^[ 0-9][ 0-9][ 0-9]\.' | while true
|
|
do
|
|
read A B C || break
|
|
SIZE=$[44+$B*2352]
|
|
echo "-r--r--r-- 4 0 0 $SIZE Jan 1 0:00 track${A}wav"
|
|
done
|
|
}
|
|
|
|
audiofs_copyout ()
|
|
{
|
|
TRACK=`echo $2 | sed 's/track//' | sed 's/\.wav//'`
|
|
cdparanoia -d $1 -v $TRACK $3
|
|
}
|
|
|
|
if [ ! -b $2 ]
|
|
then
|
|
BASE=/dev/cdrom
|
|
else
|
|
BASE=$2
|
|
fi
|
|
|
|
case "$1" in
|
|
list) audiofs_list $BASE; exit 0;;
|
|
copyout) audiofs_copyout $BASE $3 $4; exit 0;;
|
|
esac
|
|
exit 1
|