MidiBuffer::addEvent ... eh?


Am I missing something, or is the use of this “const” in the “const inst numBytes” below a bug:

void MidiBuffer::addEvent (const uint8* const newData,
const int maxBytes,
const int sampleNumber)
const int numBytes = findActualEventLength (newData, maxBytes);

… in that whenever I get in here with Dev Studio debugger, it finds out that the event is of e.g. length 3, but numBytes never changes (being const!). if I remove the const, it seems to work. Maybe I’m just getting tired…? Sorry if this is the wrong forum for posting,



No, I was getting tired, and passing-in an invalid MIDI event in the first place. Doh!!! This caused findActualEventLength to return zero, and hence my confusion… :shock: