#!/bin/sh
#
# Construct a full encoding comparison entity:
# 1 Compress/decompress audiofiles
# 2 Analyse decompressed audio files
# 3 Construct Database tables
# 4 Insert tables in database
#
# Use:
# ConstructCompress [<encodingname>] ...
#
# <encodingname> should be a known encoding
# name, e.g., MP3, Smd, Ogg40
# If you want to add a new one, please
# alter CompressAll (if needed) or fill
# the directories yourself (as with SonyMD)
# NOTE: you also have to edit the SQL scripts
# in ../DatabaseFiles/scripts/SQL/*.sql
# to include the new encoding in the diff tables.
#
# <encodingname> is the prefix to the future  or
# existing <name>SLspeech directory
# which stores the audio files (the same directory structure
# as the original SLspeech directory).
#
# For example:
# ./ConstructCompress Ogg MP3 Smd
#
# Will rework all files in 
# ../../SLspeech/home/compress/OggSLspeech
# ../../SLspeech/home/compress/MP3SLspeech
# ../../SLspeech/home/compress/SmdSLspeech
#    
# Note that ./CompressAll and ./AnalyseAll
# do not reprocess existing files! So you
# must remove target files when they should
# be reanalyzed.
#
#
# Copyright (C) 2002  R.J.J.H. van Son
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# 
#

# Iterate over compression types
for Compression in ${@:-Smd Ogg MP3 Ogg40 SOM}; do

	./CompressAll          $Compression
	./AnalyseAll           $Compression
	./CreateAllDBtables    $Compression
	./InsertCompressAudio  $Compression

done;
