From: Eric S. Raymond Date: Mon, 24 Jan 2005 15:54:00 +0000 (+0000) Subject: Implement runtime control of error frequency and volume. X-Git-Tag: 2.0~15 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=c0ce3c24c42543034a7aa7ca7cbe204ce67868dc;p=morse-classic.git Implement runtime control of error frequency and volume. --- diff --git a/morse.c b/morse.c index 32c3d08..122dde7 100644 --- 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]);