13 Aug
2016
13 Aug
'16
1:51 p.m.
Felipe F. Tonello wrote:
This patch adds a new options to amidi tool to add a delay (in milliseconds) to each MIDI message.
^^^^ Not anymore.
if (!delay) {
if ((err = snd_rawmidi_write(output, send_data, send_data_length)) < 0) {
error("cannot send data: %s", snd_strerror(err));
return err;
}
} else {
Too much indentation.
/* find beginning of SysEx and its end */
while((unsigned char)data[len] != 0xf0 &&
(data + len) < (send_data + send_data_length))
len++;
while((unsigned char)data[len] != 0xf7 &&
(data + len) < (send_data + send_data_length))
len++;
len++;
It is not necessary to search for both beginning and end.
And the search can be simplified with memchr().
Regards, Clemens