[BACK]Return to defs.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / sndiod

Annotation of src/usr.bin/sndiod/defs.h, Revision 1.1

1.1     ! ratchov     1: /*     $OpenBSD$       */
        !             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:  * Log levels:
        !            22:  *
        !            23:  * 0 - fatal errors: bugs, asserts, internal errors.
        !            24:  * 1 - warnings: bugs in clients, failed allocations, non-fatal errors.
        !            25:  * 2 - misc information (hardware parameters, incoming clients)
        !            26:  * 3 - structural changes (new aproc structures and files stream params changes)
        !            27:  * 4 - data blocks and messages
        !            28:  */
        !            29: extern unsigned int log_level;
        !            30:
        !            31: /*
        !            32:  * MIDI buffer size
        !            33:  */
        !            34: #define MIDI_BUFSZ             3125    /* 1 second at 31.25kbit/s */
        !            35:
        !            36: /*
        !            37:  * units used for MTC clock.
        !            38:  */
        !            39: #define MTC_SEC                        2400    /* 1 second is 2400 ticks */
        !            40:
        !            41: /*
        !            42:  * device or sub-device mode, must be a superset of corresponding SIO_
        !            43:  * and MIO_ constants
        !            44:  */
        !            45: #define MODE_PLAY      0x01    /* allowed to play */
        !            46: #define MODE_REC       0x02    /* allowed to rec */
        !            47: #define MODE_MIDIOUT   0x04    /* allowed to read midi */
        !            48: #define MODE_MIDIIN    0x08    /* allowed to write midi */
        !            49: #define MODE_MON       0x10    /* allowed to monitor */
        !            50: #define MODE_RECMASK   (MODE_REC | MODE_MON)
        !            51: #define MODE_AUDIOMASK (MODE_PLAY | MODE_REC | MODE_MON)
        !            52: #define MODE_MIDIMASK  (MODE_MIDIIN | MODE_MIDIOUT)
        !            53:
        !            54: /*
        !            55:  * underrun/overrun policies, must be the same as SIO_ constants
        !            56:  */
        !            57: #define XRUN_IGNORE    0       /* on xrun silently insert/discard samples */
        !            58: #define XRUN_SYNC      1       /* catchup to sync to the mix/sub */
        !            59: #define XRUN_ERROR     2       /* xruns are errors, eof/hup buffer */
        !            60:
        !            61: /*
        !            62:  * limits
        !            63:  */
        !            64: #define NCHAN_MAX      16              /* max channel in a stream */
        !            65: #define RATE_MIN       4000            /* min sample rate */
        !            66: #define RATE_MAX       192000          /* max sample rate */
        !            67: #define BITS_MIN       1               /* min bits per sample */
        !            68: #define BITS_MAX       32              /* max bits per sample */
        !            69:
        !            70: #endif /* !defined(DEFS_H) */