]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blob - sound/core/seq/oss/seq_oss_event.h
Linux-2.6.12-rc2
[mirror_ubuntu-focal-kernel.git] / sound / core / seq / oss / seq_oss_event.h
1 /*
2 * OSS compatible sequencer driver
3 *
4 * seq_oss_event.h - OSS event queue record
5 *
6 * Copyright (C) 1998,99 Takashi Iwai <tiwai@suse.de>
7 *
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.
12 *
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.
17 *
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
21 */
22
23 #ifndef __SEQ_OSS_EVENT_H
24 #define __SEQ_OSS_EVENT_H
25
26 #include "seq_oss_device.h"
27
28 #define SHORT_EVENT_SIZE 4
29 #define LONG_EVENT_SIZE 8
30
31 /* short event (4bytes) */
32 typedef struct evrec_short_t {
33 unsigned char code;
34 unsigned char parm1;
35 unsigned char dev;
36 unsigned char parm2;
37 } evrec_short_t;
38
39 /* short note events (4bytes) */
40 typedef struct evrec_note_t {
41 unsigned char code;
42 unsigned char chn;
43 unsigned char note;
44 unsigned char vel;
45 } evrec_note_t;
46
47 /* long timer events (8bytes) */
48 typedef struct evrec_timer_t {
49 unsigned char code;
50 unsigned char cmd;
51 unsigned char dummy1, dummy2;
52 unsigned int time;
53 } evrec_timer_t;
54
55 /* long extended events (8bytes) */
56 typedef struct evrec_extended_t {
57 unsigned char code;
58 unsigned char cmd;
59 unsigned char dev;
60 unsigned char chn;
61 unsigned char p1, p2, p3, p4;
62 } evrec_extended_t;
63
64 /* long channel events (8bytes) */
65 typedef struct evrec_long_t {
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;
72 } evrec_long_t;
73
74 /* channel voice events (8bytes) */
75 typedef struct evrec_voice_t {
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;
82 } evrec_voice_t;
83
84 /* sysex events (8bytes) */
85 typedef struct evrec_sysex_t {
86 unsigned char code;
87 unsigned char dev;
88 unsigned char buf[6];
89 } evrec_sysex_t;
90
91 /* event record */
92 union evrec_t {
93 evrec_short_t s;
94 evrec_note_t n;
95 evrec_long_t l;
96 evrec_voice_t v;
97 evrec_timer_t t;
98 evrec_extended_t e;
99 evrec_sysex_t x;
100 unsigned int echo;
101 unsigned char c[LONG_EVENT_SIZE];
102 };
103
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)
106
107 int snd_seq_oss_process_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev);
108 int snd_seq_oss_process_timer_event(seq_oss_timer_t *rec, evrec_t *q);
109 int snd_seq_oss_event_input(snd_seq_event_t *ev, int direct, void *private_data, int atomic, int hop);
110
111
112 #endif /* __SEQ_OSS_EVENT_H */