Changes in examples/utils.c [ce54752:a07fdb4]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/utils.c
rce54752 ra07fdb4 55 55 // more general stuff 56 56 smpl_t silence_threshold = -90.; 57 smpl_t release_drop = 10.; 57 58 uint_t mix_input = 0; 58 59 … … 76 77 77 78 #if HAVE_JACK 79 #define MAX_MIDI_EVENTS 128 80 #define MAX_MIDI_EVENT_SIZE 3 78 81 aubio_jack_t *jack_setup; 79 82 jack_midi_event_t ev; 83 jack_midi_data_t midi_data[MAX_MIDI_EVENTS * MAX_MIDI_EVENT_SIZE]; 84 size_t midi_event_count = 0; 80 85 #endif /* HAVE_JACK */ 81 86 … … 129 134 void examples_common_del (void) 130 135 { 131 #ifdef HAVE_JACK132 if (ev.buffer) free(ev.buffer);133 #endif134 136 del_fvec (ibuf); 135 137 del_fvec (obuf); … … 147 149 148 150 #ifdef HAVE_JACK 149 ev.size = 3; 150 ev.buffer = malloc (3 * sizeof (jack_midi_data_t)); 151 ev.size = MAX_MIDI_EVENT_SIZE; 151 152 ev.time = 0; // send it now 152 153 debug ("Jack activation ...\n"); … … 194 195 #ifdef HAVE_JACK 195 196 if (usejack) { 197 ev.buffer = midi_data + midi_event_count++ * MAX_MIDI_EVENT_SIZE; 198 if (midi_event_count >= MAX_MIDI_EVENTS) { 199 midi_event_count = 0; 200 } 196 201 ev.buffer[2] = velo; 197 202 ev.buffer[1] = pitch;
Note: See TracChangeset
for help on using the changeset viewer.