- # Quick hack to avoid tagging Ogg/Speex, since there is no other way to tag than inline tagging
- if [ ! "$DOTAG" = "y" ]; then
- $RUN_COMMAND nice $EFFECTIVE_NICE $SPEEXENCODER $SPEEXENCODEROPTS --author "$TRACKARTIST" --title "$TRACKNAME" --comment "$COMMENT" "$IN" "$OUT"
+ # Tag the file at encode time, as it can't be done after encoding.
+ if [ "$DOTAG" = "y" ]; then
+ RUN_COMMAND nice $EFFECTIVE_NICE $SPEEXENCODER $SPEEXENCODEROPTS --author "$TRACKARTIST" --title "$TRACKNAME" ${COMMENT:+--comment "$COMMENT"} "$IN" "$OUT"
- # Quick hack to avoid tagging Ogg/Speex, since there is no other way to tag than inline tagging
- if [ ! "$DOTAG" = "y" ]; then
+ # Tag the file at encode time, as it can't be done after encoding.
+ if [ "$DOTAG" = "y" ]; then
vecho -n "Getting CD track info... "
# In OSX, unmount the disc before a query
if [ "$OSFLAVOUR" = "OSX" ]; then
vecho -n "Getting CD track info... "
# In OSX, unmount the disc before a query
if [ "$OSFLAVOUR" = "OSX" ]; then
#vecho "Using builtin cue2discid implementation..."
CUESHEET="$(metaflac $METAFLACOPTS --export-cuesheet-to=- "$CDROM")"
#vecho "Using builtin cue2discid implementation..."
CUESHEET="$(metaflac $METAFLACOPTS --export-cuesheet-to=- "$CDROM")"
fi
# In OSX, remount the disc again
if [ "$OSFLAVOUR" = "OSX" ]; then
fi
# In OSX, remount the disc again
if [ "$OSFLAVOUR" = "OSX" ]; then
if [ ! "$RET" = "0" ];then
log warning "something went wrong while querying the CD... Maybe a DATA CD?"
fi
if [ ! "$RET" = "0" ];then
log warning "something went wrong while querying the CD... Maybe a DATA CD?"
fi
CDPARANOIAAUDIOTRACKS="$TRACKS"
else
# Previous versions of abcde would store the tracks on a file, instead of the status record.
CDPARANOIAAUDIOTRACKS="$TRACKS"
else
# Previous versions of abcde would store the tracks on a file, instead of the status record.
if [ ! -f "$ABCDETEMPDIR/discid" ]; then
# Wipe and start fresh
echo "abcde: $ABCDETEMPDIR/discid not found. Abcde must remove and recreate" >&2
if [ ! -f "$ABCDETEMPDIR/discid" ]; then
# Wipe and start fresh
echo "abcde: $ABCDETEMPDIR/discid not found. Abcde must remove and recreate" >&2
# Make sure we get a valid choice
CDDBLOCALCHOICENUM=$(echo $CDDBLOCALCHOICE | xargs printf %d 2>/dev/null)
if [ $CDDBLOCALCHOICENUM -lt 0 ] || [ $CDDBLOCALCHOICENUM -gt $CDDBLOCALCHOICES ]; then
# Make sure we get a valid choice
CDDBLOCALCHOICENUM=$(echo $CDDBLOCALCHOICE | xargs printf %d 2>/dev/null)
if [ $CDDBLOCALCHOICENUM -lt 0 ] || [ $CDDBLOCALCHOICENUM -gt $CDDBLOCALCHOICES ]; then
# List out disc title/author and contents
do_cddbparse "${CDDBLOCALFILE}"
#if [ "$CDROMREADERSYNTAX" = "flac" ] ; then
# List out disc title/author and contents
do_cddbparse "${CDDBLOCALFILE}"
#if [ "$CDROMREADERSYNTAX" = "flac" ] ; then
echo -n "Which entry would you like abcde to use (0 for none)? [0-$CDDBCHOICES]: " >&2
read CDDBCHOICE
[ X"$CDDBCHOICE" = "X" ] && CDDBCHOICE=1
echo -n "Which entry would you like abcde to use (0 for none)? [0-$CDDBCHOICES]: " >&2
read CDDBCHOICE
[ X"$CDDBCHOICE" = "X" ] && CDDBCHOICE=1
if [ ! X"$DIFF" = "X" ]; then
PARSECHOICE1=$(echo $CDDBCHOICE | cut -d"," -f1 | xargs printf %d 2>/dev/null)
PARSECHOICE2=$(echo $CDDBCHOICE | cut -d"," -f2 | xargs printf %d 2>/dev/null)
if [ ! X"$DIFF" = "X" ]; then
PARSECHOICE1=$(echo $CDDBCHOICE | cut -d"," -f1 | xargs printf %d 2>/dev/null)
PARSECHOICE2=$(echo $CDDBCHOICE | cut -d"," -f2 | xargs printf %d 2>/dev/null)
# Make sure we get a valid choice
CDCHOICENUM=$(echo $CDDBCHOICE | xargs printf %d 2>/dev/null)
if [ $CDCHOICENUM -lt 0 ] || [ $CDCHOICENUM -gt $CDDBCHOICES ]; then
# Make sure we get a valid choice
CDCHOICENUM=$(echo $CDDBCHOICE | xargs printf %d 2>/dev/null)
if [ $CDCHOICENUM -lt 0 ] || [ $CDCHOICENUM -gt $CDDBCHOICES ]; then
# Some heuristics first. Look at Disc Title, and if it starts with
# "Various", then we'll assume Various Artists
# Some heuristics first. Look at Disc Title, and if it starts with
# "Various", then we'll assume Various Artists
if [ "$(grep -c "^TTITLE.*\/" "$CDDBDATA")" -gt "$(expr $NUMTRACKS / 2 )" ]; then
# More than 1/2 tracks contain a "/", so guess forward
DEFAULTSTYLE=1
if [ "$(grep -c "^TTITLE.*\/" "$CDDBDATA")" -gt "$(expr $NUMTRACKS / 2 )" ]; then
# More than 1/2 tracks contain a "/", so guess forward
DEFAULTSTYLE=1
# submit the modified file, if they want
if [ "$NOSUBMIT" != "y" ]; then
# submit the modified file, if they want
if [ "$NOSUBMIT" != "y" ]; then
read YESNO
while [ "$YESNO" != "y" ] && [ "$YESNO" != "n" ] && [ "$YESNO" != "Y" ] && \
[ "$YESNO" != "N" ] && [ "$YESNO" != "" ]
read YESNO
while [ "$YESNO" != "y" ] && [ "$YESNO" != "n" ] && [ "$YESNO" != "Y" ] && \
[ "$YESNO" != "N" ] && [ "$YESNO" != "" ]
cdda2wav | icedax)
if [ "$OSFLAVOUR" = "OSX" ] ; then
# Hei, we have to unmount the device before running anything like cdda2wav/icedax in OSX
cdda2wav | icedax)
if [ "$OSFLAVOUR" = "OSX" ] ; then
# Hei, we have to unmount the device before running anything like cdda2wav/icedax in OSX
# Also, in OSX the cdrom device for cdda2wav/icedax changes...
CDDA2WAVCDROM="IODVDServices"
elif [ "$OSFLAVOUR" = "FBSD" ] ; then
# Also, in OSX the cdrom device for cdda2wav/icedax changes...
CDDA2WAVCDROM="IODVDServices"
elif [ "$OSFLAVOUR" = "FBSD" ] ; then
elif [ -e /dev/cd0c ]; then
CDROM=/dev/cd0c
elif [ -e /dev/acd0c ]; then
CDROM=/dev/acd0c
elif [ -e /dev/disk1 ]; then
CDROM=/dev/disk1
elif [ -e /dev/cd0c ]; then
CDROM=/dev/cd0c
elif [ -e /dev/acd0c ]; then
CDROM=/dev/acd0c
elif [ -e /dev/disk1 ]; then
CDROM=/dev/disk1
FLACENCODEROPTS="${FLACENCODEROPTS} --replay-gain"
fi
# FLAC streams can be encapsulated on a Ogg transport layer
FLACENCODEROPTS="${FLACENCODEROPTS} --replay-gain"
fi
# FLAC streams can be encapsulated on a Ogg transport layer
log error "FLAC on an Ogg container is not yet supported"
log error "due to problem with adding comments to such files"
exit 1
log error "FLAC on an Ogg container is not yet supported"
log error "due to problem with adding comments to such files"
exit 1
# Make sure a buncha things exist
for X in $CDROMREADER $CDDISCID ${NEEDTAGGER+$TAGGER} $MP3ENCODER \
$OGGENCODER $FLACENCODER $SPEEXENCODER $MPPENCODER \
# Make sure a buncha things exist
for X in $CDROMREADER $CDDISCID ${NEEDTAGGER+$TAGGER} $MP3ENCODER \
$OGGENCODER $FLACENCODER $SPEEXENCODER $MPPENCODER \
${NEEDATOMICPARSLEY+$ATOMICPARSLEY} \
${NEEDHTTPGET+$HTTPGET} ${NEEDDISTMP3+$DISTMP3} \
${NEEDCOMMENTER+$VORBISCOMMENT} ${NEEDMETAFLAC+$METAFLAC} \
${NEEDNORMALIZER+$NORMALIZER} ${NEEDEJECT+$EJECT} \
${NEEDATOMICPARSLEY+$ATOMICPARSLEY} \
${NEEDHTTPGET+$HTTPGET} ${NEEDDISTMP3+$DISTMP3} \
${NEEDCOMMENTER+$VORBISCOMMENT} ${NEEDMETAFLAC+$METAFLAC} \
${NEEDNORMALIZER+$NORMALIZER} ${NEEDEJECT+$EJECT} \
${NEEDVORBISGAIN+$VORBISGAIN} ${NEEDMP3GAIN+$MP3GAIN} \
${NEEDMPPGAIN+$MPPGAIN} ${NEEDCUEREADER+$CUEREADER} \
${NEEDCUE2DISCID+$CUE2DISCID}
${NEEDVORBISGAIN+$VORBISGAIN} ${NEEDMP3GAIN+$MP3GAIN} \
${NEEDMPPGAIN+$MPPGAIN} ${NEEDCUEREADER+$CUEREADER} \
${NEEDCUE2DISCID+$CUE2DISCID}
## Now that we have metaflac, check if we need cue2discid
#case $CDROMREADERSYNTAX in
# flac)
## Now that we have metaflac, check if we need cue2discid
#case $CDROMREADERSYNTAX in
# flac)
fi
# Check if we have moved all the formats we had previously encoded, if we are not using the FORCE.
if [ "$DOCLEAN" = "y" ] && [ ! "$FORCE" = "y" ]; then
fi
# Check if we have moved all the formats we had previously encoded, if we are not using the FORCE.
if [ "$DOCLEAN" = "y" ] && [ ! "$FORCE" = "y" ]; then
- ENCODED_FORMATS=$(egrep "^encodetrack-(.{3,6})-(.{1,2})$" "$ABCDETEMPDIR/status" | cut -d"-" -f2 | sort -u | tr '\n' '|')
- MOVED_FORMATS=$(egrep "^movetrack-output-(.{3,6})$" "$ABCDETEMPDIR/status" | cut -d"-" -f3 | sort -u | tr '\n' '|')
+ ENCODED_FORMATS=$(grep -E "^encodetrack-(.{3,6})-(.{1,2})$" "$ABCDETEMPDIR/status" | cut -d"-" -f2 | sort -u | tr '\n' '|')
+ MOVED_FORMATS=$(grep -E "^movetrack-output-(.{3,6})$" "$ABCDETEMPDIR/status" | cut -d"-" -f3 | sort -u | tr '\n' '|')
if [ "$ENCODED_FORMATS" != "$MOVED_FORMATS" ]; then
log warning "The encoded formats does not match with the moved ones"
log warning "Formats encoded: $( echo $ENCODED_FORMATS | tr "|" " " )"
if [ "$ENCODED_FORMATS" != "$MOVED_FORMATS" ]; then
log warning "The encoded formats does not match with the moved ones"
log warning "Formats encoded: $( echo $ENCODED_FORMATS | tr "|" " " )"