Lines Matching refs:ev
33 static void note_event(struct snd_midi_event *dev, struct snd_seq_event *ev);
34 static void one_param_ctrl_event(struct snd_midi_event *dev, struct snd_seq_event *ev);
35 static void pitchbend_ctrl_event(struct snd_midi_event *dev, struct snd_seq_event *ev);
36 static void two_param_ctrl_event(struct snd_midi_event *dev, struct snd_seq_event *ev);
37 static void one_param_event(struct snd_midi_event *dev, struct snd_seq_event *ev);
38 static void songpos_event(struct snd_midi_event *dev, struct snd_seq_event *ev);
39 static void note_decode(struct snd_seq_event *ev, unsigned char *buf);
40 static void one_param_decode(struct snd_seq_event *ev, unsigned char *buf);
41 static void pitchbend_decode(struct snd_seq_event *ev, unsigned char *buf);
42 static void two_param_decode(struct snd_seq_event *ev, unsigned char *buf);
43 static void songpos_decode(struct snd_seq_event *ev, unsigned char *buf);
51 void (*encode)(struct snd_midi_event *dev, struct snd_seq_event *ev);
52 void (*decode)(struct snd_seq_event *ev, unsigned char *buf);
84 struct snd_seq_event *ev);
86 struct snd_seq_event *ev);
91 struct snd_seq_event *ev);
171 struct snd_seq_event *ev) in snd_midi_event_encode_byte() argument
177 ev->type = status_event[ST_SPECIAL + c - 0xf0].event; in snd_midi_event_encode_byte()
178 ev->flags &= ~SNDRV_SEQ_EVENT_LENGTH_MASK; in snd_midi_event_encode_byte()
179 ev->flags |= SNDRV_SEQ_EVENT_LENGTH_FIXED; in snd_midi_event_encode_byte()
180 return ev->type != SNDRV_SEQ_EVENT_NONE; in snd_midi_event_encode_byte()
208 ev->type = status_event[dev->type].event; in snd_midi_event_encode_byte()
209 ev->flags &= ~SNDRV_SEQ_EVENT_LENGTH_MASK; in snd_midi_event_encode_byte()
210 ev->flags |= SNDRV_SEQ_EVENT_LENGTH_FIXED; in snd_midi_event_encode_byte()
212 status_event[dev->type].encode(dev, ev); in snd_midi_event_encode_byte()
219 ev->flags &= ~SNDRV_SEQ_EVENT_LENGTH_MASK; in snd_midi_event_encode_byte()
220 ev->flags |= SNDRV_SEQ_EVENT_LENGTH_VARIABLE; in snd_midi_event_encode_byte()
221 ev->type = SNDRV_SEQ_EVENT_SYSEX; in snd_midi_event_encode_byte()
222 ev->data.ext.len = dev->read; in snd_midi_event_encode_byte()
223 ev->data.ext.ptr = dev->buf; in snd_midi_event_encode_byte()
237 static void note_event(struct snd_midi_event *dev, struct snd_seq_event *ev) in note_event() argument
239 ev->data.note.channel = dev->buf[0] & 0x0f; in note_event()
240 ev->data.note.note = dev->buf[1]; in note_event()
241 ev->data.note.velocity = dev->buf[2]; in note_event()
245 static void one_param_ctrl_event(struct snd_midi_event *dev, struct snd_seq_event *ev) in one_param_ctrl_event() argument
247 ev->data.control.channel = dev->buf[0] & 0x0f; in one_param_ctrl_event()
248 ev->data.control.value = dev->buf[1]; in one_param_ctrl_event()
252 static void pitchbend_ctrl_event(struct snd_midi_event *dev, struct snd_seq_event *ev) in pitchbend_ctrl_event() argument
254 ev->data.control.channel = dev->buf[0] & 0x0f; in pitchbend_ctrl_event()
255 ev->data.control.value = (int)dev->buf[2] * 128 + (int)dev->buf[1] - 8192; in pitchbend_ctrl_event()
259 static void two_param_ctrl_event(struct snd_midi_event *dev, struct snd_seq_event *ev) in two_param_ctrl_event() argument
261 ev->data.control.channel = dev->buf[0] & 0x0f; in two_param_ctrl_event()
262 ev->data.control.param = dev->buf[1]; in two_param_ctrl_event()
263 ev->data.control.value = dev->buf[2]; in two_param_ctrl_event()
267 static void one_param_event(struct snd_midi_event *dev, struct snd_seq_event *ev) in one_param_event() argument
269 ev->data.control.value = dev->buf[1]; in one_param_event()
273 static void songpos_event(struct snd_midi_event *dev, struct snd_seq_event *ev) in songpos_event() argument
275 ev->data.control.value = (int)dev->buf[2] * 128 + (int)dev->buf[1]; in songpos_event()
283 struct snd_seq_event *ev) in snd_midi_event_decode() argument
287 if (ev->type == SNDRV_SEQ_EVENT_NONE) in snd_midi_event_decode()
291 if (ev->type == status_event[type].event) in snd_midi_event_decode()
295 if (ev->type == extra_event[type].event) in snd_midi_event_decode()
296 return extra_event[type].decode(dev, buf, count, ev); in snd_midi_event_decode()
305 cmd = 0x80 | (type << 4) | (ev->data.note.channel & 0x0f); in snd_midi_event_decode()
310 return snd_seq_expand_var_event(ev, count, buf, 1, 0); in snd_midi_event_decode()
322 status_event[type].decode(ev, xbuf + 1); in snd_midi_event_decode()
327 status_event[type].decode(ev, xbuf + 0); in snd_midi_event_decode()
340 static void note_decode(struct snd_seq_event *ev, unsigned char *buf) in note_decode() argument
342 buf[0] = ev->data.note.note & 0x7f; in note_decode()
343 buf[1] = ev->data.note.velocity & 0x7f; in note_decode()
347 static void one_param_decode(struct snd_seq_event *ev, unsigned char *buf) in one_param_decode() argument
349 buf[0] = ev->data.control.value & 0x7f; in one_param_decode()
353 static void pitchbend_decode(struct snd_seq_event *ev, unsigned char *buf) in pitchbend_decode() argument
355 int value = ev->data.control.value + 8192; in pitchbend_decode()
361 static void two_param_decode(struct snd_seq_event *ev, unsigned char *buf) in two_param_decode() argument
363 buf[0] = ev->data.control.param & 0x7f; in two_param_decode()
364 buf[1] = ev->data.control.value & 0x7f; in two_param_decode()
368 static void songpos_decode(struct snd_seq_event *ev, unsigned char *buf) in songpos_decode() argument
370 buf[0] = ev->data.control.value & 0x7f; in songpos_decode()
371 buf[1] = (ev->data.control.value >> 7) & 0x7f; in songpos_decode()
376 int count, struct snd_seq_event *ev) in extra_decode_ctrl14() argument
381 cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f); in extra_decode_ctrl14()
382 if (ev->data.control.param < 0x20) { in extra_decode_ctrl14()
392 buf[idx++] = ev->data.control.param; in extra_decode_ctrl14()
393 buf[idx++] = (ev->data.control.value >> 7) & 0x7f; in extra_decode_ctrl14()
396 buf[idx++] = ev->data.control.param + 0x20; in extra_decode_ctrl14()
397 buf[idx++] = ev->data.control.value & 0x7f; in extra_decode_ctrl14()
406 buf[idx++] = ev->data.control.param & 0x7f; in extra_decode_ctrl14()
407 buf[idx++] = ev->data.control.value & 0x7f; in extra_decode_ctrl14()
414 int count, struct snd_seq_event *ev) in extra_decode_xrpn() argument
433 cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f); in extra_decode_xrpn()
434 bytes[0] = (ev->data.control.param & 0x3f80) >> 7; in extra_decode_xrpn()
435 bytes[1] = ev->data.control.param & 0x007f; in extra_decode_xrpn()
436 bytes[2] = (ev->data.control.value & 0x3f80) >> 7; in extra_decode_xrpn()
437 bytes[3] = ev->data.control.value & 0x007f; in extra_decode_xrpn()
443 cbytes = ev->type == SNDRV_SEQ_EVENT_NONREGPARAM ? cbytes_nrpn : cbytes_rpn; in extra_decode_xrpn()