Re: [LAD] Segfault when trying to dereference __midi_event.buffer (c++ newbie question)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: SxDx <sed@...>
Cc: Shani Hadiyanto Pribadi <shanipribadi@...>, <linux-audio-dev@...>
Date: Wednesday, November 21, 2012 - 12:30 pm

Am 21.11.2012 13:24, schrieb SxDx:

here is how we access jack_midi in data.

// ----- jack process callback for the midi input
void MidiControllerList::compute_midi_in(void* midi_input_port_buf) {
jack_midi_event_t in_event;
jack_nframes_t event_count =
jack_midi_get_event_count(midi_input_port_buf);
unsigned int i;
for (i = 0; i < event_count; i++) {
jack_midi_event_get(&in_event, midi_input_port_buf, i);
if ((in_event.buffer[0] & 0xf0) == 0xc0) { // program change
on any midi channel
gx_system::atomic_set(&program_change, in_event.buffer[1]);
pgm_chg();
} else if ((in_event.buffer[0] & 0xf0) == 0xb0) { // controller
set_ctr_val(in_event.buffer[1], in_event.buffer[2]);
}
}
}

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] Segfault when trying to dereference __midi_event.buffe..., Shani Hadiyanto Pribadi, (Wed Nov 21, 11:54 am)
Re: [LAD] Segfault when trying to dereference __midi_event.b..., hermann meyer, (Wed Nov 21, 12:30 pm)
Re: [LAD] Segfault when trying to dereference __midi_event.b..., Shani Hadiyanto Pribadi, (Wed Nov 21, 12:49 pm)
Re: [LAD] Segfault when trying to dereference __midi_event.b..., Harry van Haaren, (Wed Nov 21, 12:14 pm)