mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.2 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/misc/output/speech
  9. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. # first we will construct a universal 'say' function
  23. function say() {
  24. if [ $ROCKCFG_OUTPUT_SPEECH_OWNSCRIPT -eq 1 ] ; then
  25. echo $* | ($ROCKCFG_OUTPUT_SPEECH_SAYPROG 2>&1) > /dev/null
  26. else
  27. if [ $ROCKCFG_OUTPUT_SPEECH_USEFESTIVAL -eq 1 ] ; then
  28. echo $* | $ROCKCFG_OUTPUT_SPEECH_FESTIVAL --tts - ;
  29. else
  30. echo $* | $ROCKCFG_OUTPUT_SPEECH_TXT2PHO \
  31. | $ROCKCFG_OUTPUT_SPEECH_MBROLA $ROCKCFG_OUTPUT_SPEECH_VOICEFILE - -.wav \
  32. | $ROCKCFG_OUTPUT_SPEECH_PLAY ;
  33. fi ;
  34. fi ;
  35. }
  36. # A free-form header at start of a section usually followed by calls to
  37. # echo_status_terminal().
  38. #
  39. echo_header_speech() {
  40. [ $ROCKCFG_OUTPUT_SPEECH_ENABLE_HEADER -eq 1 ] && say "$*"
  41. }
  42. # A free-form status message informaing the user of what is happening just
  43. # now.
  44. #
  45. echo_status_speech() {
  46. [ $ROCKCFG_OUTPUT_SPEECH_ENABLE_STATUS -eq 1 ] && say "$*"
  47. }
  48. # A free-form error or warning message if something fails.
  49. #
  50. echo_error_speech() {
  51. [ $ROCKCFG_OUTPUT_SPEECH_ENABLE_ERROR -eq 1 ] && say "$*"
  52. }
  53. # We deny to build a package for some reason.
  54. #
  55. # Usage: echo_pkg_deny <stagelevel> <package-name> <reason>
  56. #
  57. echo_pkg_deny_speech() {
  58. [ $ROCKCFG_OUTPUT_SPEECH_ENABLE_PKG_DENY -eq 1 ] &&
  59. say `eval echo "$ROCKCFG_OUTPUT_SPEECH_TXT_PKG_DENY"`
  60. }
  61. # We start building a package.
  62. #
  63. # Usage: echo_pkg_start <stagelevel> <repository> <package-name> \
  64. # <ver> <extraver>
  65. #
  66. echo_pkg_start_speech() {
  67. [ $ROCKCFG_OUTPUT_SPEECH_ENABLE_PKG_START -eq 1 ] &&
  68. say `eval echo "$ROCKCFG_OUTPUT_SPEECH_TXT_PKG_START"`
  69. }
  70. # We finished building a package.
  71. #
  72. # Usage: echo_pkg_finish <stagelevel> <repository> <package-name>
  73. #
  74. echo_pkg_finish_speech() {
  75. [ $ROCKCFG_OUTPUT_SPEECH_ENABLE_PKG_FINISH -eq 1 ] &&
  76. say `eval echo "$ROCKCFG_OUTPUT_SPEECH_TXT_PKG_FINISH"`
  77. }
  78. # We aborted building a package.
  79. #
  80. # Usage: echo_pkg_abort <stagelevel> <repository> <package-name>
  81. #
  82. echo_pkg_abort_speech() {
  83. [ $ROCKCFG_OUTPUT_SPEECH_ENABLE_PKG_ABORT -eq 1 ] &&
  84. say `eval echo "$ROCKCFG_OUTPUT_SPEECH_TXT_PKG_ABORT"`
  85. }
  86. # Whenever the tail of error logs are printed, this function is used for
  87. # that. The parameter may contain newlines.
  88. #
  89. echo_errorquote_speech() {
  90. [ $ROCKCFG_OUTPUT_SPEECH_ENABLE_ERRORQUOTE -eq 1 ] &&
  91. say `eval echo "$ROCKCFG_OUTPUT_SPEECH_TXT_ERRORQUOTE"`
  92. }