|
# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
|
|
#
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
|
# Please add additional copyright information _after_ the line containing
|
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
|
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
|
|
#
|
|
# ROCK Linux: rock-src/misc/output/speech
|
|
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
|
|
#
|
|
# 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. A copy of the GNU General Public
|
|
# License can be found at Documentation/COPYING.
|
|
#
|
|
# Many people helped and are helping developing ROCK Linux. Please
|
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
|
|
# file for details.
|
|
#
|
|
# --- ROCK-COPYRIGHT-NOTE-END ---
|
|
|
|
# first we will construct a universal 'say' function
|
|
function say() {
|
|
if [ $ROCKCFG_OUTPUT_SPEECH_OWNSCRIPT -eq 1 ] ; then
|
|
echo $* | ($ROCKCFG_OUTPUT_SPEECH_SAYPROG 2>&1) > /dev/null
|
|
else
|
|
if [ $ROCKCFG_OUTPUT_SPEECH_USEFESTIVAL -eq 1 ] ; then
|
|
|
|
echo $* | $ROCKCFG_OUTPUT_SPEECH_FESTIVAL --tts - ;
|
|
else
|
|
echo $* | $ROCKCFG_OUTPUT_SPEECH_TXT2PHO \
|
|
| $ROCKCFG_OUTPUT_SPEECH_MBROLA $ROCKCFG_OUTPUT_SPEECH_VOICEFILE - -.wav \
|
|
| $ROCKCFG_OUTPUT_SPEECH_PLAY ;
|
|
fi ;
|
|
fi ;
|
|
}
|
|
|
|
# A free-form header at start of a section usually followed by calls to
|
|
# echo_status_terminal().
|
|
#
|
|
echo_header_speech() {
|
|
[ $ROCKCFG_OUTPUT_SPEECH_ENABLE_HEADER -eq 1 ] && say "$*"
|
|
}
|
|
|
|
# A free-form status message informaing the user of what is happening just
|
|
# now.
|
|
#
|
|
echo_status_speech() {
|
|
[ $ROCKCFG_OUTPUT_SPEECH_ENABLE_STATUS -eq 1 ] && say "$*"
|
|
}
|
|
|
|
# A free-form error or warning message if something fails.
|
|
#
|
|
echo_error_speech() {
|
|
[ $ROCKCFG_OUTPUT_SPEECH_ENABLE_ERROR -eq 1 ] && say "$*"
|
|
}
|
|
|
|
# We deny to build a package for some reason.
|
|
#
|
|
# Usage: echo_pkg_deny <stagelevel> <package-name> <reason>
|
|
#
|
|
echo_pkg_deny_speech() {
|
|
[ $ROCKCFG_OUTPUT_SPEECH_ENABLE_PKG_DENY -eq 1 ] &&
|
|
say `eval echo "$ROCKCFG_OUTPUT_SPEECH_TXT_PKG_DENY"`
|
|
}
|
|
|
|
# We start building a package.
|
|
#
|
|
# Usage: echo_pkg_start <stagelevel> <repository> <package-name> \
|
|
# <ver> <extraver>
|
|
#
|
|
echo_pkg_start_speech() {
|
|
[ $ROCKCFG_OUTPUT_SPEECH_ENABLE_PKG_START -eq 1 ] &&
|
|
say `eval echo "$ROCKCFG_OUTPUT_SPEECH_TXT_PKG_START"`
|
|
}
|
|
|
|
# We finished building a package.
|
|
#
|
|
# Usage: echo_pkg_finish <stagelevel> <repository> <package-name>
|
|
#
|
|
echo_pkg_finish_speech() {
|
|
[ $ROCKCFG_OUTPUT_SPEECH_ENABLE_PKG_FINISH -eq 1 ] &&
|
|
say `eval echo "$ROCKCFG_OUTPUT_SPEECH_TXT_PKG_FINISH"`
|
|
}
|
|
|
|
# We aborted building a package.
|
|
#
|
|
# Usage: echo_pkg_abort <stagelevel> <repository> <package-name>
|
|
#
|
|
echo_pkg_abort_speech() {
|
|
[ $ROCKCFG_OUTPUT_SPEECH_ENABLE_PKG_ABORT -eq 1 ] &&
|
|
say `eval echo "$ROCKCFG_OUTPUT_SPEECH_TXT_PKG_ABORT"`
|
|
}
|
|
|
|
# Whenever the tail of error logs are printed, this function is used for
|
|
# that. The parameter may contain newlines.
|
|
#
|
|
echo_errorquote_speech() {
|
|
[ $ROCKCFG_OUTPUT_SPEECH_ENABLE_ERRORQUOTE -eq 1 ] &&
|
|
say `eval echo "$ROCKCFG_OUTPUT_SPEECH_TXT_ERRORQUOTE"`
|
|
}
|
|
|