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