1 /* $OpenBSD: defs.h,v 1.5 2020/02/26 13:53:58 ratchov Exp $ */ 2 /* 3 * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> 4 * 5 * Permission to use, copy, modify, and distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 */ 17 #ifndef DEFS_H 18 #define DEFS_H 19 20 /* 21 * MIDI buffer size 22 */ 23 #define MIDI_BUFSZ 3125 /* 1 second at 31.25kbit/s */ 24 25 /* 26 * units used for MTC clock. Must allow a quarter of frame to be 27 * represented at any of the standard 24, 25, or 30 fps. 28 */ 29 #define MTC_SEC 2400 /* 1 second is 2400 ticks */ 30 31 /* 32 * device or sub-device mode, must be a superset of corresponding SIO_ 33 * and MIO_ constants 34 */ 35 #define MODE_PLAY 0x01 /* allowed to play */ 36 #define MODE_REC 0x02 /* allowed to rec */ 37 #define MODE_MIDIOUT 0x04 /* allowed to read midi */ 38 #define MODE_MIDIIN 0x08 /* allowed to write midi */ 39 #define MODE_MON 0x10 /* allowed to monitor */ 40 #define MODE_CTLREAD 0x100 /* allowed to read controls */ 41 #define MODE_CTLWRITE 0x200 /* allowed to change controls */ 42 #define MODE_RECMASK (MODE_REC | MODE_MON) 43 #define MODE_AUDIOMASK (MODE_PLAY | MODE_REC | MODE_MON) 44 #define MODE_MIDIMASK (MODE_MIDIIN | MODE_MIDIOUT) 45 #define MODE_CTLMASK (MODE_CTLREAD | MODE_CTLWRITE) 46 47 /* 48 * underrun/overrun policies, must be the same as SIO_ constants 49 */ 50 #define XRUN_IGNORE 0 /* on xrun silently insert/discard samples */ 51 #define XRUN_SYNC 1 /* catchup to sync to the mix/sub */ 52 #define XRUN_ERROR 2 /* xruns are errors, eof/hup buffer */ 53 54 /* 55 * limits 56 */ 57 #define NCHAN_MAX 64 /* max channel in a stream */ 58 #define RATE_MIN 4000 /* min sample rate */ 59 #define RATE_MAX 192000 /* max sample rate */ 60 #define BITS_MIN 1 /* min bits per sample */ 61 #define BITS_MAX 32 /* max bits per sample */ 62 63 #endif /* !defined(DEFS_H) */ 64