1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* Copyright (C) 2008 Andreas Persson * |
* Copyright (C) 2008 - 2010 Andreas Persson * |
4 |
* * |
* * |
5 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
6 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
165 |
hJackClient = pJackClient->hJackClient; |
hJackClient = pJackClient->hJackClient; |
166 |
existingJackDevices++; |
existingJackDevices++; |
167 |
|
|
168 |
AcquirePorts(((DeviceCreationParameterInt*)Parameters["PORTS"])->ValueAsInt()); |
AcquirePorts(((DeviceCreationParameterInt*)Parameters["PORTS"])->ValueAsInt()); |
169 |
if (((DeviceCreationParameterBool*)Parameters["ACTIVE"])->ValueAsBool()) { |
if (((DeviceCreationParameterBool*)Parameters["ACTIVE"])->ValueAsBool()) { |
170 |
Listen(); |
Listen(); |
171 |
} |
} |
172 |
} |
} |
173 |
|
|
174 |
MidiInputDeviceJack::~MidiInputDeviceJack() { |
MidiInputDeviceJack::~MidiInputDeviceJack() { |
210 |
} |
} |
211 |
|
|
212 |
String MidiInputDeviceJack::Version() { |
String MidiInputDeviceJack::Version() { |
213 |
String s = "$Revision: 1.4 $"; |
String s = "$Revision: 1.5 $"; |
214 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
215 |
} |
} |
216 |
|
|
225 |
#else |
#else |
226 |
int event_count = jack_midi_get_event_count(port_buffer); |
int event_count = jack_midi_get_event_count(port_buffer); |
227 |
#endif |
#endif |
228 |
for (int i = 0 ; i < event_count ; i++) |
for (int i = 0 ; i < event_count ; i++) { |
|
{ |
|
229 |
jack_midi_event_t ev; |
jack_midi_event_t ev; |
230 |
#if JACK_MIDI_FUNCS_NEED_NFRAMES |
#if JACK_MIDI_FUNCS_NEED_NFRAMES |
231 |
jack_midi_event_get(&ev, port_buffer, i, nsamples); // old jack version |
jack_midi_event_get(&ev, port_buffer, i, nsamples); // old jack version |
232 |
#else |
#else |
233 |
jack_midi_event_get(&ev, port_buffer, i); |
jack_midi_event_get(&ev, port_buffer, i); |
234 |
#endif |
#endif |
235 |
port->DispatchRaw(ev.buffer, ev.time); |
if (ev.buffer) { // jack2 1.9.5 has been seen sending NULL here |
236 |
|
port->DispatchRaw(ev.buffer, ev.time); |
237 |
|
} |
238 |
} |
} |
239 |
} |
} |
240 |
} |
} |