Lines Matching full:length
20 static const int length[] = { 3, 3, 3, 3, 2, 2, 3 }; in midibuf_message_length() local
22 message_length = length[(code >> 4) - 8]; in midibuf_message_length()
24 static const int length[] = { -1, 2, 2, 2, -1, -1, 1, 1, 1, -1, in midibuf_message_length() local
27 message_length = length[code & 0x0f]; in midibuf_message_length()
81 int length) in line6_midibuf_write() argument
87 if (midibuf_is_full(this) || (length <= 0)) in line6_midibuf_write()
91 if (data[length - 1] == 0xfe) { in line6_midibuf_write()
92 --length; in line6_midibuf_write()
98 if (length > bytes_free) in line6_midibuf_write()
99 length = bytes_free; in line6_midibuf_write()
101 if (length > 0) { in line6_midibuf_write()
104 if (length < length1) { in line6_midibuf_write()
106 memcpy(this->buf + this->pos_write, data, length); in line6_midibuf_write()
107 this->pos_write += length; in line6_midibuf_write()
110 length2 = length - length1; in line6_midibuf_write()
120 return length + skip_active_sense; in line6_midibuf_write()
124 int length, int read_type) in line6_midibuf_read() argument
134 if (length < 3) in line6_midibuf_read()
142 if (length > bytes_used) in line6_midibuf_read()
143 length = bytes_used; in line6_midibuf_read()
162 /* check MIDI command length */ in line6_midibuf_read()
182 if (length < length1) { in line6_midibuf_read()
184 for (i = 1; i < length; ++i) in line6_midibuf_read()
191 length2 = length - length1; in line6_midibuf_read()
208 if (midi_length == length) in line6_midibuf_read()
216 if (length < midi_length) in line6_midibuf_read()
219 length = midi_length; in line6_midibuf_read()
222 if (length < length1) { in line6_midibuf_read()
224 memcpy(data + repeat, this->buf + this->pos_read, length); in line6_midibuf_read()
225 this->pos_read += length; in line6_midibuf_read()
228 length2 = length - length1; in line6_midibuf_read()
238 return length + repeat; in line6_midibuf_read()
241 int line6_midibuf_ignore(struct midi_buffer *this, int length) in line6_midibuf_ignore() argument
245 if (length > bytes_used) in line6_midibuf_ignore()
246 length = bytes_used; in line6_midibuf_ignore()
248 this->pos_read = (this->pos_read + length) % this->size; in line6_midibuf_ignore()
250 return length; in line6_midibuf_ignore()