library: Add fake library generating script
I assign tags to the 1, 10, 60, and 600 second long ogg files as they are copied to the new library directory. This is much faster than generating sound files on the fly, but it makes this commit 2.5MB in size... Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
parent
6a29066ac7
commit
b176a48c6c
BIN
tests/library/1.ogg
Normal file
BIN
tests/library/1.ogg
Normal file
Binary file not shown.
BIN
tests/library/10.ogg
Normal file
BIN
tests/library/10.ogg
Normal file
Binary file not shown.
BIN
tests/library/60.ogg
Normal file
BIN
tests/library/60.ogg
Normal file
Binary file not shown.
BIN
tests/library/600.ogg
Normal file
BIN
tests/library/600.ogg
Normal file
Binary file not shown.
76
tests/library/gen_library.sh
Executable file
76
tests/library/gen_library.sh
Executable file
|
@ -0,0 +1,76 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2013 (c) Anna Schumaker.
|
||||
#
|
||||
# Generate a test library in /tmp
|
||||
#
|
||||
|
||||
declare -A genres
|
||||
genres["Album 0"]=Test
|
||||
genres["Album 1"]=Trial
|
||||
genres["Album 2"]=Tryout
|
||||
|
||||
declare -A dates
|
||||
dates["Album 0"]=2011
|
||||
dates["Album 1"]=2012
|
||||
dates["Album 2"]=2013
|
||||
|
||||
#
|
||||
# gen_tracks() $library $artist $album
|
||||
#
|
||||
function gen_tracks()
|
||||
{
|
||||
library="library/$1"
|
||||
artist="Artist $2"
|
||||
album="Album $3"
|
||||
|
||||
mkdir -p "/tmp/$library/$artist/$album"
|
||||
|
||||
for i in $(seq 10); do
|
||||
track="Track $i"
|
||||
let remainder=$i%4
|
||||
|
||||
case $remainder in
|
||||
0) OGG="1.ogg" ;;
|
||||
1) OGG="10.ogg" ;;
|
||||
2) OGG="60.ogg" ;;
|
||||
3) OGG="600.ogg" ;;
|
||||
esac
|
||||
|
||||
vorbiscomment -a -q -t "ARTIST=$artist" -t "ALBUM=$album" \
|
||||
-t "GENRE=${genres[$album]}" -t "DATE=${dates[$album]}" \
|
||||
-t "TRACK=$i" -t "TITLE=$track" "tests/library/$OGG" \
|
||||
"/tmp/$library/$artist/$album/$i - $track.ogg"
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
# gen_albums() $library $artist
|
||||
#
|
||||
function gen_albums()
|
||||
{
|
||||
let begin=$2*3
|
||||
let end=$begin+3
|
||||
|
||||
for i in $(seq $begin $end); do
|
||||
gen_tracks $1 $2 $i
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
# gen_artists() $library
|
||||
#
|
||||
function gen_artists()
|
||||
{
|
||||
let begin=$1*5
|
||||
let end=$begin+4
|
||||
|
||||
for i in $(seq $begin $end); do
|
||||
gen_albums $1 $i
|
||||
done
|
||||
}
|
||||
|
||||
for i in $(seq 0 4); do
|
||||
echo "Generating library: $i"
|
||||
gen_artists $i
|
||||
done
|
Loading…
Reference in New Issue
Block a user