dottes/makeAll.sh

159 lines
3.5 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
#
# Build all forms of the Booke.
#
# Arguments are the names of the bookes to build. If a name is
2019-07-08 09:46:52 +01:00
# prefixed '-', then do not include that section in the Bumper Booke.
if [[ $# -lt 1 ]]; then
echo "Usage: makeAll.sh <booke dir name> [<booke dir name> ...]"
exit 1
fi
2019-03-26 17:54:07 +00:00
# Make the print version of a booke.
# Params: <booke dir>
makeBookePrint()
{
# Print graphics.
./makeGraphics.sh "$1"
# Normal graphics printed output.
./makeBookeTunePages.sh "$1"
./makeBooke.sh A4 "$1"
# ./makeBooke.sh A4NoCover "$1"
./makeBooke.sh Nook "$1"
# Compact graphics printed output.
./makeBookeTunePages.sh --use-compact "$1"
2016-11-04 23:34:41 +00:00
./makeBooke.sh A5 "$1"
./makeBooklet.sh "$1"
# ./makeBooke.sh A5NoCover "$1"
2019-03-26 17:54:07 +00:00
}
# Make a single booke.
# Params: <booke dir> [<instrument name>]
makeABooke()
{
makeBookePrint "$1"
# Web output.
./makeWebGraphics.sh "$1"
./makeWebAudio.sh "$1"
./makeWeb.sh "$1" "$1" "$2"
}
2019-03-26 17:54:07 +00:00
# Make a single transposed booke. We use web audio from the
# master booke.
# Params: <booke dir> <master booke dir> [<instrument name>]
makeATransposedBooke()
{
2019-03-26 17:54:07 +00:00
makeBookePrint "$1"
# Web output. Uses audio from main booke.
./makeWebGraphics.sh "$1"
./makeWeb.sh "$1" "$2" "$3"
}
makeASingleBooke()
{
makeABooke $1
./makeCello.sh $1
makeATransposedBooke $1-Cello $1 cello
./makeHornInF.sh $1
makeATransposedBooke $1-HornInF $1 "horn in F"
./makeAltoRecorderCFingering.sh $1
makeATransposedBooke $1-AltoRecorderCFingering $1 "alto recorder, C fingering"
2020-02-03 10:49:27 +00:00
./makeAltoSax.sh $1
makeATransposedBooke $1-AltoSax $1 "alto saxophone"
}
2013-02-20 13:03:40 +00:00
2019-03-26 17:54:07 +00:00
makeABumperBooke()
{
# This can only be used once all the other Bookes have been built.
for booke in "$@"
do
./makeBookeTunePages.sh "${booke}"
done
./makeBooke.sh A4 "$@"
# ./makeBooke.sh A4NoCover "$@"
./makeBooke.sh Nook "$@"
for booke in "$@"
do
./makeBookeTunePages.sh --use-compact "${booke}"
done
./makeBooke.sh A5 "$@"
./makeBooklet.sh "Bumper"
# ./makeBooke.sh A5NoCover "$@"
}
2019-03-26 17:54:07 +00:00
makeBumperBookes()
{
makeABumperBooke "$@"
for f in Bumper*.pdf
do
mv $f ./web
done
local cellobumper
local hornbumber
local recorderbumper
2020-02-03 10:49:27 +00:00
local saxbumper
for booke in "$@"
do
cellobumper+=("${booke}-Cello")
hornbumper+=("${booke}-HornInF")
recorderbumper+=("${booke}-AltoRecorderCFingering")
2020-02-03 10:49:27 +00:00
saxbumper+=("${booke}-AltoSax")
done
makeABumperBooke "${cellobumper[@]}"
for f in Bumper*.pdf
do
t=$(echo $f | sed -e "s/.pdf/-Cello.pdf/")
mv $f ./web/$t
done
makeABumperBooke "${hornbumper[@]}"
for f in Bumper*.pdf
do
t=$(echo $f | sed -e "s/.pdf/-HornInF.pdf/")
mv $f ./web/$t
done
makeABumperBooke "${recorderbumper[@]}"
for f in Bumper*.pdf
do
t=$(echo $f | sed -e "s/.pdf/-AltoRecorderCFingering.pdf/")
mv $f ./web/$t
done
2020-02-03 10:49:27 +00:00
makeABumperBooke "${saxbumper[@]}"
for f in Bumper*.pdf
do
t=$(echo $f | sed -e "s/.pdf/-AltoSax.pdf/")
mv $f ./web/$t
done
2019-03-26 17:54:07 +00:00
}
declare buildBookes
declare bumperBookes
for booke in "$@"
do
if [[ ${booke:0:1} = "-" ]]; then
booke=${booke/#-/}
else
bumperBookes+=("$booke")
fi
buildBookes+=("$booke")
done
for booke in "${buildBookes[@]}"
do
makeASingleBooke $booke
done
if [[ ${#bumperBookes[@]} -gt 1 ]]; then
2019-03-26 17:54:07 +00:00
makeBumperBookes "${bumperBookes[@]}"
fi