diff options
Diffstat (limited to 'ocaml-binary-annot/otherlibs/graph/sound.c')
| -rw-r--r-- | ocaml-binary-annot/otherlibs/graph/sound.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ocaml-binary-annot/otherlibs/graph/sound.c b/ocaml-binary-annot/otherlibs/graph/sound.c new file mode 100644 index 0000000000..dc75b7ed03 --- /dev/null +++ b/ocaml-binary-annot/otherlibs/graph/sound.c @@ -0,0 +1,34 @@ +/***********************************************************************/ +/* */ +/* Objective Caml */ +/* */ +/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ +/* */ +/* Copyright 1996 Institut National de Recherche en Informatique et */ +/* en Automatique. All rights reserved. This file is distributed */ +/* under the terms of the GNU Library General Public License, with */ +/* the special exception on linking described in file ../../LICENSE. */ +/* */ +/***********************************************************************/ + +/* $Id$ */ + +#include "libgraph.h" + +value caml_gr_sound(value vfreq, value vdur) +{ + XKeyboardControl kbdcontrol; + + caml_gr_check_open(); + kbdcontrol.bell_pitch = Int_val(vfreq); + kbdcontrol.bell_duration = Int_val(vdur); + XChangeKeyboardControl(caml_gr_display, KBBellPitch | KBBellDuration, + &kbdcontrol); + XBell(caml_gr_display, 0); + kbdcontrol.bell_pitch = -1; /* restore default value */ + kbdcontrol.bell_duration = -1; /* restore default value */ + XChangeKeyboardControl(caml_gr_display, KBBellPitch | KBBellDuration, + &kbdcontrol); + XFlush(caml_gr_display); + return Val_unit; +} |
