Annotation of src/usr.bin/sndiod/defs.h, Revision 1.3
1.3 ! ratchov 1: /* $OpenBSD: defs.h,v 1.2 2012/12/07 08:04:58 ratchov Exp $ */
1.1 ratchov 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: /*
1.3 ! ratchov 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.
1.1 ratchov 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_RECMASK (MODE_REC | MODE_MON)
41: #define MODE_AUDIOMASK (MODE_PLAY | MODE_REC | MODE_MON)
42: #define MODE_MIDIMASK (MODE_MIDIIN | MODE_MIDIOUT)
43:
44: /*
45: * underrun/overrun policies, must be the same as SIO_ constants
46: */
47: #define XRUN_IGNORE 0 /* on xrun silently insert/discard samples */
48: #define XRUN_SYNC 1 /* catchup to sync to the mix/sub */
49: #define XRUN_ERROR 2 /* xruns are errors, eof/hup buffer */
50:
51: /*
52: * limits
53: */
54: #define NCHAN_MAX 16 /* max channel in a stream */
55: #define RATE_MIN 4000 /* min sample rate */
56: #define RATE_MAX 192000 /* max sample rate */
57: #define BITS_MIN 1 /* min bits per sample */
58: #define BITS_MAX 32 /* max bits per sample */
59:
60: #endif /* !defined(DEFS_H) */