]> thyrsus.com Git - morse-classic.git/commitdiff
Implement runtime control of error frequency and volume.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 24 Jan 2005 15:54:00 +0000 (15:54 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 24 Jan 2005 15:54:00 +0000 (15:54 +0000)
morse.c

diff --git a/morse.c b/morse.c
index 32c3d08c7f5bbbe0959c94921bd7589ccc59ca25..122dde79583e44dccf58300636f90c0206f4967e 100644 (file)
--- a/morse.c
+++ b/morse.c
@@ -1665,17 +1665,14 @@ int             resync;
                     * Scold them for their mistake.
                     */
                    printf ("\n");
-#ifdef ERROR_VOLUME
-#ifndef ERROR_FREQ
-#define ERROR_FREQ     2000.
-#endif
-                   /* Beep using the tone generator */
-                   toneflush ();
-                   tone ((float) (ERROR_FREQ), .1, (float) (ERROR_VOLUME));
-#else
-                   /* Beep using control-G */
-                   printf ("\007");
-#endif
+
+                   if (error_volume) {
+                       /* Beep using the tone generator */
+                       toneflush ();
+                       tone (error_frequency, 0.1, error_volume);
+                   } else
+                       /* Beep using control-G */
+                       printf ("\007");
                    printf ("%c (%s) for %c (%s)\n",
                            yourchar, code[yourcharnocase],
                            correctchar, code[correctchar]);