/** An event (much like a type generic jack_midi_event_t)
*
- * Template parameter Timestamp is the type of the time stamp used for this event.
+ * Template parameter Time is the type of the time stamp used for this event.
*/
-template<typename Timestamp>
+template<typename Time>
struct Event {
#ifdef EVORAL_EVENT_ALLOC
- Event(EventType type=0, Timestamp timestamp=0, uint32_t size=0, uint8_t* buffer=NULL, bool alloc=false);
+ Event(EventType type=0, Time time=0, uint32_t size=0, uint8_t* buf=NULL, bool alloc=false);
/** Copy \a copy.
*
_buf = copy._buf;
}
- inline void set(uint8_t* buf, uint32_t size, Timestamp t) {
+ inline void set(uint8_t* buf, uint32_t size, Time t) {
if (_owns_buf) {
if (_size < size) {
_buf = (uint8_t*) ::realloc(_buf, size);
inline EventType event_type() const { return _type; }
inline void set_event_type(EventType t) { _type = t; }
- inline Timestamp time() const { return _time; }
- inline Timestamp& time() { return _time; }
+ inline Time time() const { return _time; }
+ inline Time& time() { return _time; }
inline uint32_t size() const { return _size; }
inline uint32_t& size() { return _size; }
protected:
EventType _type; /**< Type of event (application relative, NOT MIDI 'type') */
- Timestamp _time; /**< Sample index (or beat time) at which event is valid */
+ Time _time; /**< Sample index (or beat time) at which event is valid */
uint32_t _size; /**< Number of uint8_ts of data in \a buffer */
uint8_t* _buf; /**< Raw MIDI data */