From: Bastian Dehn Date: Sat, 25 Nov 2017 07:46:55 +0000 (+0100) Subject: change: all in function flactomp3v2 X-Git-Tag: v1.0.0^2~90 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=19a8c70e793f4e4c4079ba669a9fb2bc9d718427;p=albentohandy.git change: all in function flactomp3v2 --- diff --git a/flactomp3v2 b/flactomp3v2 index 8e489db..8242e9d 100755 --- a/flactomp3v2 +++ b/flactomp3v2 @@ -2,15 +2,17 @@ ### Script converts flac to mp3 and added ID3-Tag ### include cover and replaygain Information from flac file -# Default options -BITRATE=192 -MODE="j" +DefaultVariables() { + BITRATE=192 + MODE="j" +} -# check config exists # config .flactomp3v2.conf can set BITRATE and MODE -if [ -f $HOME/.flactomp3v2.conf ]; then - source $HOME/.flactomp3v2.conf -fi +LoadConfigFile() { + if [ -f $HOME/.flactomp3v2.conf ]; then + source $HOME/.flactomp3v2.conf + fi +} ReadFlacToMp3Tags() { local readonly INPUTFILE="$1" @@ -66,6 +68,9 @@ main() { local readonly INPUTFILE="$1" local readonly OUTPUTFILE="${INPUTFILE[@]/%flac/mp3}" + DefaultVariables + LoadConfigFile + EncodingFlacToMp3 "$INPUTFILE" "$OUTPUTFILE" ReadFlacToMp3Tags "$INPUTFILE" "$OUTPUTFILE" }