#
# Copyright (C) by Stefano Falsetto
# e-mail contact ....: mailto:stefko5@inwind.it
#
#    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
#
#
# Config plugin for (phase 3) normalize

configure_normalize () {
  begin_check normalize
  find_prg normalize
  NORMALIZE=$FOUND_PRG
  if [ -z $NORMALIZE ]; then
    missing normalize "http://www.cs.columbia.edu/~cvaill/normalize/"
  else
    DESCRIPTION="Adjust WAV files to a standard volume"
    WHERE=end
    PARAMETERS="--normalize|-n"
    QueryVersion "$(normalize -V 2>&1|head -n 1|cut -d ' ' -f2)" normalize "0.5.1" "0.6.1" "0.7.1"
    OPZNORM=" -v "
    DEFMETNORM=" -b "
    DEFNORM="batch"
    echo
    #lechoc CYAN "Command line to use this plugin:"
    #lechoc YELLOW " -> --normalize|-n"
    lechoc CYAN "Command used (default method %s):" "$DEFNORM"
    lechoc YELLOW " -> %s %s %s" "$NORMALIZE" "$OPZNORM" "$DEFMETNORM"
  fi
  end_check
}

cat_variables_normalize () {
if [ ! -z "$NORMALIZE" ]; then
cat <<EOF
# Complete path for normalize
NORMALIZE="$NORMALIZE"

# If set normalize wav files by default
NORM=""

# Global options for normalize
OPZNORM="$OPZNORM"

# Default method to normalize
DEFMETNORM="$DEFMETNORM"

# Name of default normalize method
DEFNORM="$DEFNORM"

EOF
fi
}
