1158979Snetchild/*-
2166322Sjoel * Copyright (c) 2003 Mathew Kanner
3166322Sjoel * All rights reserved.
4166322Sjoel *
5158979Snetchild * Redistribution and use in source and binary forms, with or without
6166322Sjoel * modification, are permitted provided that the following conditions
7166322Sjoel * are met:
8166322Sjoel * 1. Redistributions of source code must retain the above copyright
9166322Sjoel *    notice, this list of conditions and the following disclaimer.
10166322Sjoel * 2. Redistributions in binary form must reproduce the above copyright
11166322Sjoel *    notice, this list of conditions and the following disclaimer in the
12166322Sjoel *    documentation and/or other materials provided with the distribution.
13166322Sjoel *
14166322Sjoel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15166322Sjoel * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16166322Sjoel * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17166322Sjoel * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18166322Sjoel * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19166322Sjoel * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20166322Sjoel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21166322Sjoel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22158979Snetchild * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23158979Snetchild * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24158979Snetchild * SUCH DAMAGE.
25158979Snetchild *
26158979Snetchild * $FreeBSD$
27158979Snetchild */
28158979Snetchild
29158979Snetchild#ifndef MIDI_H
30158979Snetchild#define MIDI_H
31158979Snetchild
32158979Snetchild#include <sys/types.h>
33158979Snetchild#include <sys/malloc.h>
34158979Snetchild
35158979SnetchildMALLOC_DECLARE(M_MIDI);
36158979Snetchild
37158979Snetchild#define M_RX		0x01
38158979Snetchild#define M_TX		0x02
39158979Snetchild#define M_RXEN		0x04
40158979Snetchild#define M_TXEN		0x08
41158979Snetchild
42158979Snetchild#define MIDI_TYPE unsigned char
43158979Snetchild
44158979Snetchildstruct snd_midi;
45158979Snetchild
46166971Snetchildstruct snd_midi *
47166971Snetchildmidi_init(kobj_class_t _mpu_cls, int _unit, int _channel, void *cookie);
48166971Snetchildint	midi_uninit(struct snd_midi *_m);
49166971Snetchildint	midi_out(struct snd_midi *_m, MIDI_TYPE *_buf, int _size);
50166971Snetchildint	midi_in(struct snd_midi *_m, MIDI_TYPE *_buf, int _size);
51158979Snetchild
52166971Snetchildkobj_t	midimapper_addseq(void *arg1, int *unit, void **cookie);
53166971Snetchildint	midimapper_open(void *arg1, void **cookie);
54166971Snetchildint	midimapper_close(void *arg1, void *cookie);
55166971Snetchildkobj_t	midimapper_fetch_synth(void *arg, void *cookie, int unit);
56158979Snetchild
57158979Snetchild#endif
58