X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsupport%2Fconsoleio.cpp;h=fd895e861474dd31e6abcd45224f4bff96a3d634;hp=bc6df45616097ad93b83514dff67dec8e4750006;hb=2d39e823ba389fc68e5317c422b55be006094252;hpb=a95e41ac40cd2f3a4401d921618604cf33f2a904 diff --git a/libctsupport/consoleio.cpp b/libctsupport/consoleio.cpp index bc6df45..fd895e8 100644 --- a/libctsupport/consoleio.cpp +++ b/libctsupport/consoleio.cpp @@ -2,7 +2,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: consoleio.cpp,v 1.2 2000/06/19 19:04:05 kevin Exp $ +** $Id: consoleio.cpp,v 1.3 2000/06/22 10:17:28 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -144,3 +144,36 @@ cio_kb_waitc (const char *astr, int beep_on_error) } +/* NAME + * beep sound a beep to user + * + * SYNOPSIS + * beep() + */ + +void cio_beep (void) +{ + cio_tone (2000.0, 0.3); +} + +/* NAME + * tone play a frequency sound for some duration + * + * SYNOPSIS + * tone (freq, length) + * double freq frequency to play in Hertz + * double length duration to play note in seconds + */ + +void +cio_tone (double freq, double length) +{ +#if 1 + fprintf(stdout, "\007"); +#else + cio_spkr_freq (freq); /* Set frequency of tone */ + cio_spkr_on (); /* Turn on speaker */ + pause (length); /* Pause for length seconds */ + cio_spkr_off (); /* Turn off speaker */ +#endif +}