]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
remove: flactovorbis integration in albentohandy
authorBastian Dehn <hhaalo@arcor.de>
Sat, 5 Dec 2020 16:11:13 +0000 (17:11 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 5 Dec 2020 16:11:13 +0000 (17:11 +0100)
albentohandy
flactovorbis [deleted file]

index 908be81520f5b735f2d8b5a4140ca38b3d5d3651..2eeb430bb77042b824cb55e3388cd134ed7abbc5 100755 (executable)
@@ -46,16 +46,53 @@ MakeSymlinksToWork()
 
 }
 
+ReadFlacToOggTags()
+{
+       local readonly INPUTFILE="$1"
+       local readonly OUTPUFILE="$2"
+       local readonly COVERFILE="${INPUTFILE%/*}/cover.txt"
+
+       metaflac --export-tags-to=- $INPUTFILE \
+               | vorbiscomment --commentfile - --write $OUTPUTFILE
+       if [ -f $COVERFILE ]; then
+               echo "METADATA_BLOCK_PICTURE=$(base64 --wrap 0 $COVERFILE)" \
+               | vorbiscomment --commentfile - --raw --append $OUTPUTFILE
+       fi
+}
+
+EncodingFlacToOgg()
+{
+       local readonly INPUTFILE="$1"
+       local readonly OUTPUTFILE="$2"
+
+       # stream flac into the ogg vorbis
+       nice --adjustment=10 flac --silent --stdout --decode "$INPUTFILE" \
+               | nice --adjustment=15 oggenc --quiet --quality 6 \
+               --output "$OUTPUTFILE" -
+}
+
+FlacToVorbis()
+{
+       local readonly INPUTFILE="$1"
+       local readonly OUTPUTFILE="${INPUTFILE[@]/%flac/ogg}"
+
+       EncodingFlacToOgg "$INPUTFILE" "$OUTPUTFILE"
+       ReadFlacToOggTags "$INPUTFILE" "$OUTPUTFILE"
+}
+
 ConvertFlacToOgg()
 {
        local readonly workdir="$1"
        local readonly paralleopts="$2"
        local readonly scriptdir="$3"
 
+       export -f FlacToVorbis
+       export -f ReadFlacToOggTags
+       export -f EncodingFlacToOgg
        find $workdir -name '*.flac' \
                | sort \
                | parallel --will-cite --ungroup --eta --progress \
-               --sshlogin $parallelopts $scriptdir/flactovorbis {}
+               --sshlogin $parallelopts FlacToVorbis {}
 }
 
 ConvertCoverToMeta()
diff --git a/flactovorbis b/flactovorbis
deleted file mode 100755 (executable)
index aa34de6..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-ReadFlacToOggTags()
-{
-       local readonly INPUTFILE="$1"
-       local readonly OUTPUFILE="$2"
-       local readonly COVERFILE="${INPUTFILE%/*}/cover.txt"
-
-       metaflac --export-tags-to=- $INPUTFILE \
-               | vorbiscomment --commentfile - --write $OUTPUTFILE
-       if [ -f $COVERFILE ]; then
-               echo "METADATA_BLOCK_PICTURE=$(base64 --wrap 0 $COVERFILE)" \
-               | vorbiscomment --commentfile - --raw --append $OUTPUTFILE
-       fi
-}
-
-EncodingFlacToOgg()
-{
-       local readonly INPUTFILE="$1"
-       local readonly OUTPUTFILE="$2"
-
-       # stream flac into the ogg vorbis
-       nice --adjustment=10 flac --silent --stdout --decode "$INPUTFILE" \
-               | nice --adjustment=15 oggenc --quiet --quality 6 \
-               --output "$OUTPUTFILE" -
-}
-
-main()
-{
-       local readonly INPUTFILE="$1"
-       local readonly OUTPUTFILE="${INPUTFILE[@]/%flac/ogg}"
-
-       EncodingFlacToOgg "$INPUTFILE" "$OUTPUTFILE"
-       ReadFlacToOggTags "$INPUTFILE" "$OUTPUTFILE"
-}
-
-main "$1"
-exit 0