aboutsummaryrefslogtreecommitdiff
path: root/sound/core/seq/oss/seq_oss_event.h
blob: 9a4d9adb7b8c7c73820aaa73cf4f491925d013d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
 * OSS compatible sequencer driver
 *
 * seq_oss_event.h - OSS event queue record
 *
 * Copyright (C) 1998,99 Takashi Iwai <tiwai@suse.de>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 */

#ifndef __SEQ_OSS_EVENT_H
#define __SEQ_OSS_EVENT_H

#include "seq_oss_device.h"

#define SHORT_EVENT_SIZE	4
#define LONG_EVENT_SIZE		8

/* short event (4bytes) */
struct evrec_short {
	unsigned char code;
	unsigned char parm1;
	unsigned char dev;
	unsigned char parm2;
};
	
/* short note events (4bytes) */
struct evrec_note {
	unsigned char code;
	unsigned char chn;
	unsigned char note;
	unsigned char vel;
};
	
/* long timer events (8bytes) */
struct evrec_timer {
	unsigned char code;
	unsigned char cmd;
	unsigned char dummy1, dummy2;
	unsigned int time;
};

/* long extended events (8bytes) */
struct evrec_extended {
	unsigned char code;
	unsigned char cmd;
	unsigned char dev;
	unsigned char chn;
	unsigned char p1, p2, p3, p4;
};

/* long channel events (8bytes) */
struct evrec_long {
	unsigned char code;
	unsigned char dev;
	unsigned char cmd;
	unsigned char chn;
	unsigned char p1, p2;
	unsigned short val;
};
	
/* channel voice events (8bytes) */
struct evrec_voice {
	unsigned char code;
	unsigned char dev;
	unsigned char cmd;
	unsigned char chn;
	unsigned char note, parm;
	unsigned short dummy;
};

/* sysex events (8bytes) */
struct evrec_sysex {
	unsigned char code;
	unsigned char dev;
	unsigned char buf[6];
};

/* event record */
union evrec {
	struct evrec_short s;
	struct evrec_note n;
	struct evrec_long l;
	struct evrec_voice v;
	struct evrec_timer t;
	struct evrec_extended e;
	struct evrec_sysex x;
	unsigned int echo;
	unsigned char c[LONG_EVENT_SIZE];
};

#define ev_is_long(ev) ((ev)->s.code >= 128)
#define ev_length(ev) ((ev)->s.code >= 128 ? LONG_EVENT_SIZE : SHORT_EVENT_SIZE)

int snd_seq_oss_process_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev);
int snd_seq_oss_process_timer_event(struct seq_oss_timer *rec, union evrec *q);
int snd_seq_oss_event_input(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop);


#endif /* __SEQ_OSS_EVENT_H */