1122394Sharti/*-
2122394Sharti * Copyright (c) 2003 Mathew Kanner
3122394Sharti * All rights reserved.
4122394Sharti *
5122394Sharti * Redistribution and use in source and binary forms, with or without
6122394Sharti * modification, are permitted provided that the following conditions
7122394Sharti * are met:
8122394Sharti * 1. Redistributions of source code must retain the above copyright
9122394Sharti *    notice, this list of conditions and the following disclaimer.
10122394Sharti * 2. Redistributions in binary form must reproduce the above copyright
11122394Sharti *    notice, this list of conditions and the following disclaimer in the
12122394Sharti *    documentation and/or other materials provided with the distribution.
13122394Sharti *
14122394Sharti * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15122394Sharti * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16122394Sharti * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17122394Sharti * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18122394Sharti * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19122394Sharti * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20122394Sharti * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21122394Sharti * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22122394Sharti * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23122394Sharti * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24122394Sharti * SUCH DAMAGE.
25122394Sharti *
26122394Sharti * $FreeBSD: releng/11.0/sys/dev/sound/midi/midi.h 166971 2007-02-25 13:51:52Z netchild $
27122394Sharti */
28122394Sharti
29122394Sharti#ifndef MIDI_H
30122394Sharti#define MIDI_H
31122394Sharti
32122394Sharti#include <sys/types.h>
33122394Sharti#include <sys/malloc.h>
34122394Sharti
35122394ShartiMALLOC_DECLARE(M_MIDI);
36122394Sharti
37122394Sharti#define M_RX		0x01
38122394Sharti#define M_TX		0x02
39122394Sharti#define M_RXEN		0x04
40122394Sharti#define M_TXEN		0x08
41122394Sharti
42122394Sharti#define MIDI_TYPE unsigned char
43122394Sharti
44122394Shartistruct snd_midi;
45122394Sharti
46122394Shartistruct snd_midi *
47122394Shartimidi_init(kobj_class_t _mpu_cls, int _unit, int _channel, void *cookie);
48122394Shartiint	midi_uninit(struct snd_midi *_m);
49122394Shartiint	midi_out(struct snd_midi *_m, MIDI_TYPE *_buf, int _size);
50122394Shartiint	midi_in(struct snd_midi *_m, MIDI_TYPE *_buf, int _size);
51122394Sharti
52122394Shartikobj_t	midimapper_addseq(void *arg1, int *unit, void **cookie);
53122394Shartiint	midimapper_open(void *arg1, void **cookie);
54122394Shartiint	midimapper_close(void *arg1, void *cookie);
55122394Shartikobj_t	midimapper_fetch_synth(void *arg, void *cookie, int unit);
56122394Sharti
57122394Sharti#endif
58122394Sharti