Add linux-next specific files for 20110831
[linux-2.6/next.git] / sound / core / seq / oss / seq_oss_event.h
blob9a4d9adb7b8c7c73820aaa73cf4f491925d013d2
1 /*
2 * OSS compatible sequencer driver
4 * seq_oss_event.h - OSS event queue record
6 * Copyright (C) 1998,99 Takashi Iwai <tiwai@suse.de>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef __SEQ_OSS_EVENT_H
24 #define __SEQ_OSS_EVENT_H
26 #include "seq_oss_device.h"
28 #define SHORT_EVENT_SIZE 4
29 #define LONG_EVENT_SIZE 8
31 /* short event (4bytes) */
32 struct evrec_short {
33 unsigned char code;
34 unsigned char parm1;
35 unsigned char dev;
36 unsigned char parm2;
39 /* short note events (4bytes) */
40 struct evrec_note {
41 unsigned char code;
42 unsigned char chn;
43 unsigned char note;
44 unsigned char vel;
47 /* long timer events (8bytes) */
48 struct evrec_timer {
49 unsigned char code;
50 unsigned char cmd;
51 unsigned char dummy1, dummy2;
52 unsigned int time;
55 /* long extended events (8bytes) */
56 struct evrec_extended {
57 unsigned char code;
58 unsigned char cmd;
59 unsigned char dev;
60 unsigned char chn;
61 unsigned char p1, p2, p3, p4;
64 /* long channel events (8bytes) */
65 struct evrec_long {
66 unsigned char code;
67 unsigned char dev;
68 unsigned char cmd;
69 unsigned char chn;
70 unsigned char p1, p2;
71 unsigned short val;
74 /* channel voice events (8bytes) */
75 struct evrec_voice {
76 unsigned char code;
77 unsigned char dev;
78 unsigned char cmd;
79 unsigned char chn;
80 unsigned char note, parm;
81 unsigned short dummy;
84 /* sysex events (8bytes) */
85 struct evrec_sysex {
86 unsigned char code;
87 unsigned char dev;
88 unsigned char buf[6];
91 /* event record */
92 union evrec {
93 struct evrec_short s;
94 struct evrec_note n;
95 struct evrec_long l;
96 struct evrec_voice v;
97 struct evrec_timer t;
98 struct evrec_extended e;
99 struct evrec_sysex x;
100 unsigned int echo;
101 unsigned char c[LONG_EVENT_SIZE];
104 #define ev_is_long(ev) ((ev)->s.code >= 128)
105 #define ev_length(ev) ((ev)->s.code >= 128 ? LONG_EVENT_SIZE : SHORT_EVENT_SIZE)
107 int snd_seq_oss_process_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev);
108 int snd_seq_oss_process_timer_event(struct seq_oss_timer *rec, union evrec *q);
109 int snd_seq_oss_event_input(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop);
112 #endif /* __SEQ_OSS_EVENT_H */