]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ocaml/ocaml/contrib/otherlibs/graph/sound.c
Update
[l4.git] / l4 / pkg / ocaml / ocaml / contrib / otherlibs / graph / sound.c
1 /***********************************************************************/
2 /*                                                                     */
3 /*                           Objective Caml                            */
4 /*                                                                     */
5 /*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
6 /*                                                                     */
7 /*  Copyright 1996 Institut National de Recherche en Informatique et   */
8 /*  en Automatique.  All rights reserved.  This file is distributed    */
9 /*  under the terms of the GNU Library General Public License, with    */
10 /*  the special exception on linking described in file ../../LICENSE.  */
11 /*                                                                     */
12 /***********************************************************************/
13
14 /* $Id: sound.c 6171 2004-03-24 15:02:06Z starynke $ */
15
16 #include "libgraph.h"
17
18 value caml_gr_sound(value vfreq, value vdur)
19 {
20   XKeyboardControl kbdcontrol;
21
22   caml_gr_check_open();
23   kbdcontrol.bell_pitch = Int_val(vfreq);
24   kbdcontrol.bell_duration = Int_val(vdur);
25   XChangeKeyboardControl(caml_gr_display, KBBellPitch | KBBellDuration,
26                          &kbdcontrol);
27   XBell(caml_gr_display, 0);
28   kbdcontrol.bell_pitch = -1;   /* restore default value */
29   kbdcontrol.bell_duration = -1; /* restore default value */
30   XChangeKeyboardControl(caml_gr_display, KBBellPitch | KBBellDuration,
31                          &kbdcontrol);
32   XFlush(caml_gr_display);
33   return Val_unit;
34 }