• Home
  • Raw
  • Download

Lines Matching refs:ev

57 typedef void (*event_encode_t)(snd_midi_event_t *dev, snd_seq_event_t *ev);
58 typedef void (*event_decode_t)(const snd_seq_event_t *ev, unsigned char *buf);
65 static void note_event(snd_midi_event_t *dev, snd_seq_event_t *ev);
66 static void one_param_ctrl_event(snd_midi_event_t *dev, snd_seq_event_t *ev);
67 static void pitchbend_ctrl_event(snd_midi_event_t *dev, snd_seq_event_t *ev);
68 static void two_param_ctrl_event(snd_midi_event_t *dev, snd_seq_event_t *ev);
69 static void one_param_event(snd_midi_event_t *dev, snd_seq_event_t *ev);
70 static void songpos_event(snd_midi_event_t *dev, snd_seq_event_t *ev);
71 static void note_decode(const snd_seq_event_t *ev, unsigned char *buf);
72 static void one_param_decode(const snd_seq_event_t *ev, unsigned char *buf);
73 static void pitchbend_decode(const snd_seq_event_t *ev, unsigned char *buf);
74 static void two_param_decode(const snd_seq_event_t *ev, unsigned char *buf);
75 static void songpos_decode(const snd_seq_event_t *ev, unsigned char *buf);
116 …extra_decode_ctrl14(snd_midi_event_t *dev, unsigned char *buf, int len, const snd_seq_event_t *ev);
117 …extra_decode_xrpn(snd_midi_event_t *dev, unsigned char *buf, int count, const snd_seq_event_t *ev);
121 int (*decode)(snd_midi_event_t *dev, unsigned char *buf, int len, const snd_seq_event_t *ev);
360 …midi_event_encode(snd_midi_event_t *dev, const unsigned char *buf, long count, snd_seq_event_t *ev) in snd_midi_event_encode() argument
365 ev->type = SND_SEQ_EVENT_NONE; in snd_midi_event_encode()
368 rc = snd_midi_event_encode_byte(dev, *buf++, ev); in snd_midi_event_encode()
398 int snd_midi_event_encode_byte(snd_midi_event_t *dev, int c, snd_seq_event_t *ev) in snd_midi_event_encode_byte() argument
406 ev->type = status_event[ST_SPECIAL + c - 0xf0].event; in snd_midi_event_encode_byte()
407 ev->flags &= ~SND_SEQ_EVENT_LENGTH_MASK; in snd_midi_event_encode_byte()
408 ev->flags |= SND_SEQ_EVENT_LENGTH_FIXED; in snd_midi_event_encode_byte()
409 return ev->type != SND_SEQ_EVENT_NONE; in snd_midi_event_encode_byte()
436 ev->type = status_event[dev->type].event; in snd_midi_event_encode_byte()
437 ev->flags &= ~SND_SEQ_EVENT_LENGTH_MASK; in snd_midi_event_encode_byte()
438 ev->flags |= SND_SEQ_EVENT_LENGTH_FIXED; in snd_midi_event_encode_byte()
440 status_event[dev->type].encode(dev, ev); in snd_midi_event_encode_byte()
447 ev->flags &= ~SND_SEQ_EVENT_LENGTH_MASK; in snd_midi_event_encode_byte()
448 ev->flags |= SND_SEQ_EVENT_LENGTH_VARIABLE; in snd_midi_event_encode_byte()
449 ev->type = SND_SEQ_EVENT_SYSEX; in snd_midi_event_encode_byte()
450 ev->data.ext.len = dev->read; in snd_midi_event_encode_byte()
451 ev->data.ext.ptr = dev->buf; in snd_midi_event_encode_byte()
464 static void note_event(snd_midi_event_t *dev, snd_seq_event_t *ev) in note_event() argument
466 ev->data.note.channel = dev->buf[0] & 0x0f; in note_event()
467 ev->data.note.note = dev->buf[1]; in note_event()
468 ev->data.note.velocity = dev->buf[2]; in note_event()
472 static void one_param_ctrl_event(snd_midi_event_t *dev, snd_seq_event_t *ev) in one_param_ctrl_event() argument
474 ev->data.control.channel = dev->buf[0] & 0x0f; in one_param_ctrl_event()
475 ev->data.control.value = dev->buf[1]; in one_param_ctrl_event()
479 static void pitchbend_ctrl_event(snd_midi_event_t *dev, snd_seq_event_t *ev) in pitchbend_ctrl_event() argument
481 ev->data.control.channel = dev->buf[0] & 0x0f; in pitchbend_ctrl_event()
482 ev->data.control.value = (int)dev->buf[2] * 128 + (int)dev->buf[1] - 8192; in pitchbend_ctrl_event()
486 static void two_param_ctrl_event(snd_midi_event_t *dev, snd_seq_event_t *ev) in two_param_ctrl_event() argument
488 ev->data.control.channel = dev->buf[0] & 0x0f; in two_param_ctrl_event()
489 ev->data.control.param = dev->buf[1]; in two_param_ctrl_event()
490 ev->data.control.value = dev->buf[2]; in two_param_ctrl_event()
494 static void one_param_event(snd_midi_event_t *dev, snd_seq_event_t *ev) in one_param_event() argument
496 ev->data.control.value = dev->buf[1]; in one_param_event()
500 static void songpos_event(snd_midi_event_t *dev, snd_seq_event_t *ev) in songpos_event() argument
502 ev->data.control.value = (int)dev->buf[2] * 128 + (int)dev->buf[1]; in songpos_event()
557 …midi_event_decode(snd_midi_event_t *dev, unsigned char *buf, long count, const snd_seq_event_t *ev) in snd_midi_event_decode() argument
563 if (ev->type == SND_SEQ_EVENT_NONE) in snd_midi_event_decode()
567 if (ev->type == status_event[type].event) in snd_midi_event_decode()
571 if (ev->type == extra_event[type].event) in snd_midi_event_decode()
572 return extra_event[type].decode(dev, buf, count, ev); in snd_midi_event_decode()
581 cmd = 0x80 | (type << 4) | (ev->data.note.channel & 0x0f); in snd_midi_event_decode()
586 qlen = ev->data.ext.len; in snd_midi_event_decode()
589 switch (ev->flags & SND_SEQ_EVENT_LENGTH_MASK) { in snd_midi_event_decode()
593 memcpy(buf, ev->data.ext.ptr, qlen); in snd_midi_event_decode()
602 status_event[type].decode(ev, xbuf + 1); in snd_midi_event_decode()
606 status_event[type].decode(ev, xbuf + 0); in snd_midi_event_decode()
620 static void note_decode(const snd_seq_event_t *ev, unsigned char *buf) in note_decode() argument
622 buf[0] = ev->data.note.note & 0x7f; in note_decode()
623 buf[1] = ev->data.note.velocity & 0x7f; in note_decode()
627 static void one_param_decode(const snd_seq_event_t *ev, unsigned char *buf) in one_param_decode() argument
629 buf[0] = ev->data.control.value & 0x7f; in one_param_decode()
633 static void pitchbend_decode(const snd_seq_event_t *ev, unsigned char *buf) in pitchbend_decode() argument
635 int value = ev->data.control.value + 8192; in pitchbend_decode()
641 static void two_param_decode(const snd_seq_event_t *ev, unsigned char *buf) in two_param_decode() argument
643 buf[0] = ev->data.control.param & 0x7f; in two_param_decode()
644 buf[1] = ev->data.control.value & 0x7f; in two_param_decode()
648 static void songpos_decode(const snd_seq_event_t *ev, unsigned char *buf) in songpos_decode() argument
650 buf[0] = ev->data.control.value & 0x7f; in songpos_decode()
651 buf[1] = (ev->data.control.value >> 7) & 0x7f; in songpos_decode()
655 …xtra_decode_ctrl14(snd_midi_event_t *dev, unsigned char *buf, int count, const snd_seq_event_t *ev) in extra_decode_ctrl14() argument
660 cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f); in extra_decode_ctrl14()
661 if (ev->data.control.param < 32) { in extra_decode_ctrl14()
671 buf[idx++] = ev->data.control.param; in extra_decode_ctrl14()
672 buf[idx++] = (ev->data.control.value >> 7) & 0x7f; in extra_decode_ctrl14()
675 buf[idx++] = ev->data.control.param + 32; in extra_decode_ctrl14()
676 buf[idx++] = ev->data.control.value & 0x7f; in extra_decode_ctrl14()
685 buf[idx++] = ev->data.control.param & 0x7f; in extra_decode_ctrl14()
686 buf[idx++] = ev->data.control.value & 0x7f; in extra_decode_ctrl14()
692 … extra_decode_xrpn(snd_midi_event_t *dev, unsigned char *buf, int count, const snd_seq_event_t *ev) in extra_decode_xrpn() argument
711 cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f); in extra_decode_xrpn()
712 bytes[0] = (ev->data.control.param & 0x3f80) >> 7; in extra_decode_xrpn()
713 bytes[1] = ev->data.control.param & 0x007f; in extra_decode_xrpn()
714 bytes[2] = (ev->data.control.value & 0x3f80) >> 7; in extra_decode_xrpn()
715 bytes[3] = ev->data.control.value & 0x007f; in extra_decode_xrpn()
721 cbytes = ev->type == SND_SEQ_EVENT_NONREGPARAM ? cbytes_nrpn : cbytes_rpn; in extra_decode_xrpn()