r7061: initial property settings
[ctsim.git] / libctsupport / consoleio.cpp
index bc6df45616097ad93b83514dff67dec8e4750006..763a8b1312b3b76718cde2a027cb5b4ecc59a1e7 100644 (file)
@@ -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
+}