shithub: aubio

Download patch

ref: 8ba682a1fc0ff8ccb9b5b1ed9709672406bfd1ee
parent: d47ad546cd9e72f37de236ae07684690e5512b2b
author: Paul Brossier <piem@piem.org>
date: Mon Sep 17 11:08:38 EDT 2018

examples/utils.c: define MAX_MIDI_EVENT_SIZE

--- a/examples/utils.c
+++ b/examples/utils.c
@@ -76,9 +76,10 @@
 
 #if HAVE_JACK
 #define MAX_MIDI_EVENTS 128
+#define MAX_MIDI_EVENT_SIZE 3
 aubio_jack_t *jack_setup;
 jack_midi_event_t ev;
-jack_midi_data_t midi_data[MAX_MIDI_EVENTS * 3];
+jack_midi_data_t midi_data[MAX_MIDI_EVENTS * MAX_MIDI_EVENT_SIZE];
 size_t midi_event_count = 0;
 #endif /* HAVE_JACK */
 
@@ -146,7 +147,7 @@
   if (usejack) {
 
 #ifdef HAVE_JACK
-    ev.size = 3;
+    ev.size = MAX_MIDI_EVENT_SIZE;
     ev.time = 0; // send it now
     debug ("Jack activation ...\n");
     aubio_jack_activate (jack_setup, process_func);
@@ -192,7 +193,7 @@
 {
 #ifdef HAVE_JACK
   if (usejack) {
-    ev.buffer = midi_data + midi_event_count++ * 3;
+    ev.buffer = midi_data + midi_event_count++ * MAX_MIDI_EVENT_SIZE;
     if (midi_event_count >= MAX_MIDI_EVENTS) {
       midi_event_count = 0;
     }