move decoding task creation to decodeFile()

This commit is contained in:
Vincent Riquer 2013-03-14 13:55:24 +01:00
parent 7d622bde13
commit 712201a97f

80
atom
View File

@ -974,9 +974,42 @@ decodeMpcdec() {
commandline="mpcdec \"$sourcepath/$filename\" \"$tempdir/$tmpfile.wav\""
}
encodeFile::MP3() {
#lame
:
decodeFile() {
if ! decodetaskid=$(
Select tasks id <<<"key = $tmpfile"
)
then
decodetaskid=$(
Insert tasks <<-EOInsert
key $tmpfile
source_file $fileid
command_line $commandline
status 0
cleanup $tempdir/$tmpfile.wav
EOInsert
)
progressSpin
fi
if (( sox_needed ))
then
decodeSox "$tempdir/$tmpfile.wav"
if ! soxtaskid=$(
Select tasks id <<<"key = $tmpfile"
)
then
soxtaskid=$(
Insert tasks <<-EOInsert
key $tmpfile
source_file $fileid
command_line $commandline
requires $decodetaskid
status 0
cleanup $tempdir/$tmpfile.wav
EOInsert
)
progressSpin
fi
fi
}
copyFile() {
@ -997,11 +1030,6 @@ copyFile() {
progressSpin
}
encodeFile::Ogg() {
#oggenc
:
}
transcodeFile() {
#sox -> wav
for format in $targets["format"]
@ -1376,36 +1404,17 @@ do
esac
;;
esac
if ! decodetaskid=$(
Select tasks id <<<"key = $tmpfile"
)
if ! (( copied ))
then
decodetaskid=$(
Insert tasks <<-EOInsert
key $tmpfile
command_line $commandline
status 0
EOInsert
)
progressSpin
decodeFile
fi
if (( sox_needed ))
getDestDir
getDestFile
if (( copied ))
then
decodeSox "$tempdir/$tmpfile.wav"
if ! soxtaskid=$(
Select tasks id <<<"key = $tmpfile"
)
then
soxtaskid=$(
Insert tasks <<-EOInsert
key $tmpfile
command_line $commandline
requires $decodetaskid
status 0
EOInsert
)
progressSpin
fi
copyFile
else
encodeFile::${destinationformat[$destination]}
fi
unset \
album \
@ -1415,6 +1424,7 @@ do
channels \
commandline \
composer \
copied \
decodetaskid \
destfileid \
destination \