}
uint8_t* const write_loc = _data + _size;
- *((TimeType*)write_loc) = time;
+ *(reinterpret_cast<TimeType*>((uintptr_t)write_loc)) = time;
memcpy(write_loc + stamp_size, data, size);
_size += stamp_size + size;
}
uint8_t* const write_loc = _data + insert_offset;
- *((TimeType*)write_loc) = t;
+ *(reinterpret_cast<TimeType*>((uintptr_t)write_loc)) = t;
memcpy(write_loc + stamp_size, ev.buffer(), ev.size());
_size += bytes_to_merge;
return true;
}
+uint32_t
+MidiBuffer::write(TimeType time, Evoral::EventType type, uint32_t size, const uint8_t* buf)
+{
+ insert_event(Evoral::MIDIEvent<TimeType>(type, time, size, const_cast<uint8_t*>(buf)));
+ return size;
+}
+
/** Reserve space for a new event in the buffer.
*
* This call is for copying MIDI directly into the buffer, the data location
// write timestamp
uint8_t* write_loc = _data + _size;
- *((TimeType*)write_loc) = time;
+ *(reinterpret_cast<TimeType*>((uintptr_t)write_loc)) = time;
// move write_loc to begin of MIDI buffer data to write to
write_loc += stamp_size;