Lines Matching defs:buf

46 	unsigned char *buf;	/* input buffer */
60 typedef void (*event_decode_t)(const snd_seq_event_t *ev, unsigned char *buf);
73 static void note_decode(const snd_seq_event_t *ev, unsigned char *buf);
74 static void one_param_decode(const snd_seq_event_t *ev, unsigned char *buf);
75 static void pitchbend_decode(const snd_seq_event_t *ev, unsigned char *buf);
76 static void two_param_decode(const snd_seq_event_t *ev, unsigned char *buf);
77 static void songpos_decode(const snd_seq_event_t *ev, unsigned char *buf);
118 static int extra_decode_ctrl14(snd_midi_event_t *dev, unsigned char *buf, int len, const snd_seq_event_t *ev);
119 static int extra_decode_xrpn(snd_midi_event_t *dev, unsigned char *buf, int count, const snd_seq_event_t *ev);
123 int (*decode)(snd_midi_event_t *dev, unsigned char *buf, int len, const snd_seq_event_t *ev);
161 dev->buf = malloc(bufsize);
162 if (dev->buf == NULL) {
186 free(dev->buf);
291 old_buf = dev->buf;
292 dev->buf = new_buf;
302 * \param[in] buf Buffer containing bytes of a raw MIDI stream.
303 * \param[in] count Number of bytes in \a buf.
362 long snd_midi_event_encode(snd_midi_event_t *dev, const unsigned char *buf, long count, snd_seq_event_t *ev)
370 rc = snd_midi_event_encode_byte(dev, *buf++, ev);
417 dev->buf[0] = c;
427 dev->buf[dev->read++] = c;
432 dev->buf[1] = c;
453 ev->data.ext.ptr = dev->buf;
468 ev->data.note.channel = dev->buf[0] & 0x0f;
469 ev->data.note.note = dev->buf[1];
470 ev->data.note.velocity = dev->buf[2];
476 ev->data.control.channel = dev->buf[0] & 0x0f;
477 ev->data.control.value = dev->buf[1];
483 ev->data.control.channel = dev->buf[0] & 0x0f;
484 ev->data.control.value = (int)dev->buf[2] * 128 + (int)dev->buf[1] - 8192;
490 ev->data.control.channel = dev->buf[0] & 0x0f;
491 ev->data.control.param = dev->buf[1];
492 ev->data.control.value = dev->buf[2];
498 ev->data.control.value = dev->buf[1];
504 ev->data.control.value = (int)dev->buf[2] * 128 + (int)dev->buf[1];
510 * \param[out] buf Buffer for the resulting MIDI byte stream.
511 * \param[in] count Number of bytes in \a buf.
513 * \return The number of bytes written to \a buf, or a negative error code.
516 * messages, and writes the raw MIDI byte(s) into \a buf.
559 long snd_midi_event_decode(snd_midi_event_t *dev, unsigned char *buf, long count, const snd_seq_event_t *ev)
574 return extra_event[type].decode(dev, buf, count, ev);
595 memcpy(buf, ev->data.ext.ptr, qlen);
615 memcpy(buf, xbuf, qlen);
622 static void note_decode(const snd_seq_event_t *ev, unsigned char *buf)
624 buf[0] = ev->data.note.note & 0x7f;
625 buf[1] = ev->data.note.velocity & 0x7f;
629 static void one_param_decode(const snd_seq_event_t *ev, unsigned char *buf)
631 buf[0] = ev->data.control.value & 0x7f;
635 static void pitchbend_decode(const snd_seq_event_t *ev, unsigned char *buf)
638 buf[0] = value & 0x7f;
639 buf[1] = (value >> 7) & 0x7f;
643 static void two_param_decode(const snd_seq_event_t *ev, unsigned char *buf)
645 buf[0] = ev->data.control.param & 0x7f;
646 buf[1] = ev->data.control.value & 0x7f;
650 static void songpos_decode(const snd_seq_event_t *ev, unsigned char *buf)
652 buf[0] = ev->data.control.value & 0x7f;
653 buf[1] = (ev->data.control.value >> 7) & 0x7f;
657 static int extra_decode_ctrl14(snd_midi_event_t *dev, unsigned char *buf, int count, const snd_seq_event_t *ev)
671 buf[idx++] = dev->lastcmd = cmd;
673 buf[idx++] = ev->data.control.param;
674 buf[idx++] = (ev->data.control.value >> 7) & 0x7f;
676 buf[idx++] = cmd;
677 buf[idx++] = ev->data.control.param + 32;
678 buf[idx++] = ev->data.control.value & 0x7f;
685 buf[idx++] = dev->lastcmd = cmd;
687 buf[idx++] = ev->data.control.param & 0x7f;
688 buf[idx++] = ev->data.control.value & 0x7f;
694 static int extra_decode_xrpn(snd_midi_event_t *dev, unsigned char *buf, int count, const snd_seq_event_t *ev)
721 buf[idx++] = dev->lastcmd = cmd;
726 buf[idx++] = dev->lastcmd = cmd;
727 buf[idx++] = cbytes[i];
728 buf[idx++] = bytes[i];