X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsupport%2Fconsoleio.cpp;h=763a8b1312b3b76718cde2a027cb5b4ecc59a1e7;hp=bc6df45616097ad93b83514dff67dec8e4750006;hb=8a7697ce57b56cdc43698cd1241ad98d49f9b5ac;hpb=12e2c29153a0f55ac23bdeec06b404638672985b diff --git a/libctsupport/consoleio.cpp b/libctsupport/consoleio.cpp index bc6df45..763a8b1 100644 --- a/libctsupport/consoleio.cpp +++ b/libctsupport/consoleio.cpp @@ -1,8 +1,8 @@ /***************************************************************************** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: consoleio.cpp,v 1.2 2000/06/19 19:04:05 kevin Exp $ +** $Id$ ** ** 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 +}