Home | History | Annotate | Line # | Download | only in include
      1 /*	$NetBSD: opmbellio.h,v 1.6 2024/01/07 07:58:33 isaki Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1995 Takuya Harakawa.
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *      This product includes software developed by Minoura Makoto.
     18  * 4. The name of the author may not be used to endorse or promote products
     19  *    derived from this software without specific prior written permission
     20  *
     21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31  */
     32 
     33 /*
     34  * Copyright (c) 1990 The Regents of the University of California.
     35  * All rights reserved.
     36  *
     37  * Redistribution and use in source and binary forms, with or without
     38  * modification, are permitted provided that the following conditions
     39  * are met:
     40  * 1. Redistributions of source code must retain the above copyright
     41  *    notice, this list of conditions and the following disclaimer.
     42  * 2. Redistributions in binary form must reproduce the above copyright
     43  *    notice, this list of conditions and the following disclaimer in the
     44  *    documentation and/or other materials provided with the distribution.
     45  * 3. Neither the name of the University nor the names of its contributors
     46  *    may be used to endorse or promote products derived from this software
     47  *    without specific prior written permission.
     48  *
     49  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     50  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     51  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     52  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     53  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     54  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     55  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     56  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     57  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     58  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     59  * SUCH DAMAGE.
     60  *
     61  *	$NetBSD: opmbellio.h,v 1.6 2024/01/07 07:58:33 isaki Exp $
     62  */
     63 
     64 #ifndef _X68K_OPMBELLIO_H_
     65 #define _X68K_OPMBELLIO_H_
     66 #ifndef _IOCTL_
     67 #include <sys/ioctl.h>
     68 #endif
     69 #include <machine/opmreg.h>
     70 
     71 struct bell_info {
     72     int	volume;
     73     int	pitch;
     74     int	msec;
     75 };
     76 
     77 /* default values */
     78 #define BELL_VOLUME	100	/* percentage */
     79 #define BELL_PITCH	440
     80 #define BELL_DURATION	100
     81 #define BELL_CHANNEL	7
     82 
     83 /* Initial Voice Parameter; struct opm_voice */
     84 #define DEFAULT_BELL_VOICE {				\
     85 /*  AR  DR  SR  RR  SL  OL  KS  ML DT1 DT2 AME  */	\
     86   { 31,  0,  0,  0,  0, 39,  1,  1,  0,  0,  0, },	\
     87   { 19, 11,  0, 11,  4, 37,  0,  2,  0,  0,  0, },	\
     88   { 31, 15,  0,  9,  0, 55,  1,  4,  0,  0,  0, },	\
     89   { 19, 15,  0,  9,  0,  0,  1,  1,  0,  0,  0, },	\
     90 /*  CON FL  OP  */					\
     91     3,  7, 15						\
     92 }
     93 
     94 /* limits */
     95 #define	MAXBVOLUME	100	/* 100 percent */
     96 #define	MAXBPITCH	4698
     97 #define MINBPITCH	20
     98 #define MAXBTIME	5000	/* 5 seconds */
     99 
    100 #define BELLIOCSPARAM	_IOW('B', 0x1, struct bell_info)
    101 #define BELLIOCGPARAM	_IOR('B', 0x2, struct bell_info)
    102 #define BELLIOCSVOICE	_IOW('B', 0x3, struct opm_voice)
    103 #define BELLIOCGVOICE	_IOR('B', 0x4, struct opm_voice)
    104 
    105 #endif
    106