### copy to other folder. It works on parallel, you can
### use it in a cluster with Parameter -S.
-Usage() {
+Usage()
+{
cat <<- EOF
NAME
EOF
}
-MakeSymlinksToWork() {
+MakeSymlinksToWork()
+{
local readonly workdir="$1"
local readonly musicdir="$2"
local readonly albumlist="$3"
}
-ConvertFlacToMp3() {
+ConvertFlacToMp3()
+{
local readonly workdir="$1"
local readonly basefile="$2"
local readonly paralleopts="$3"
$scriptdir/flactomp3v2 {}
}
-CleanupFlac() {
+CleanupFlac()
+{
local readonly workdir="$1"
find $workdir -name '*.flac' | \
xargs rm
}
-CleanupWorkDir() {
+CleanupWorkDir()
+{
local readonly workdir="$1"
printf "cleanup working directory\n\n"
rm --recursive $workdir
}
-CopyWorkDirToDestDir() {
+CopyWorkDirToDestDir()
+{
local readonly workdir="$1"
local readonly destdir="$2"
cp --recursive $workdir/* $destdir
}
-MakeZipFile() {
+MakeZipFile()
+{
local readonly workdir="$1"
local zipname="$2"
cd $curpath
}
-MakeSha256CheckSum() {
+MakeSha256CheckSum()
+{
local readonly workdir="$1"
find $workdir -name '*.mp3' | \
>> $workdir/sha256sum
}
-ExistsScripts() {
+ExistsScripts()
+{
local readonly scriptdir="$1"
# flactomp3v2: convert flac's to mp3
fi
}
-LoadConfig() {
+LoadConfig()
+{
# .albentohandy.conf: set SCRIPTPATH and MUSICPATH
if [ -f $HOME/.albentohandy.conf ]; then
source $HOME/.albentohandy.conf
fi
}
-ExistsBasicProgramms() {
+ExistsBasicProgramms()
+{
local exists=true
local programms=("eyeD3" "flac" "lame" "sha256sum" "7z" "parallel")
fi
}
-SetDefaultVariables() {
+SetDefaultVariables()
+{
albumlist="albumlist"
parallelopts=":"
curphase=1
cptodest=false
}
-ReadArguments() {
+ReadArguments()
+{
while getopts "chi:m:S:rw:z:" optname; do
case "$optname" in
"c")
done
}
-ExistsAlbumlist() {
+ExistsAlbumlist()
+{
local albumlist="$1"
if [ ! -f "$albumlist" ]; then
fi
}
-CreateWorkDirectory() {
+CreateWorkDirectory()
+{
local WORK="$1"
if [ ! -d $WORK ]; then
fi
}
-ConvertProcess() {
+ConvertProcess()
+{
printf "\nPhase %02d of %02d:\n" $((curphase++)) $phase
printf "create symlinks of flac's in %s\n" "$WORK"
MakeSymlinksToWork "$WORK" "$MUSICPATH" "$albumlist"
CleanupFlac "$WORK"
}
-AdvancedFeatures() {
+AdvancedFeatures()
+{
# create sha256sum in working directory
if [ $checksum == true ]; then
printf "Phase %02d of %02d: " $((curphase++)) $phase
fi
}
-main() {
+main()
+{
WORK="$(pwd)/work.$$" # temporary working directory
SCRIPTPATH="/usr/bin" # path to flactomp3v2 and notify.sh script
MUSICPATH="/tmp/musikpath" # flac collection directory
}
main $*
-
exit 0
### Script converts flac to mp3 and added ID3-Tag
### include cover and replaygain Information from flac file
-DefaultVariables() {
+DefaultVariables()
+{
BITRATE=192
MODE="j"
}
# config .flactomp3v2.conf can set BITRATE and MODE
-LoadConfigFile() {
+LoadConfigFile()
+{
if [ -f $HOME/.flactomp3v2.conf ]; then
source $HOME/.flactomp3v2.conf
fi
}
-ReadFlacToMp3Tags() {
+ReadFlacToMp3Tags()
+{
local readonly INPUTFILE="$1"
local readonly OUTPUTFILE="$2"
local readonly INPUTFILEDIR=${INPUTFILE%/*}
eval $eyed3Command
}
-EncodingFlacToMp3() {
+EncodingFlacToMp3()
+{
local readonly INPUTFILE="$1"
local readonly OUTPUTFILE="$2"
-b $BITRATE -m $MODE --noreplaygain - "$OUTPUTFILE"
}
-main() {
+main()
+{
local readonly INPUTFILE="$1"
local readonly OUTPUTFILE="${INPUTFILE[@]/%flac/mp3}"
}
main "$1"
-
exit 0