X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fevoral%2Fevoral%2FEvent.hpp;h=ec92d575d0958b0cf18328b80207d60db6af21ba;hb=ca0c9b3636fecb5fc2106b1eae33ce3eb5c53c79;hp=da8036c8f60510f3cbd02c1fb2aa9deaba05f4e9;hpb=14d601a0ffe1ceb452aba103eb35ce03320acd21;p=ardour.git diff --git a/libs/evoral/evoral/Event.hpp b/libs/evoral/evoral/Event.hpp index da8036c8f6..ec92d575d0 100644 --- a/libs/evoral/evoral/Event.hpp +++ b/libs/evoral/evoral/Event.hpp @@ -19,12 +19,12 @@ #ifndef EVORAL_EVENT_HPP #define EVORAL_EVENT_HPP -#include #include #include #include #include +#include "evoral/visibility.h" #include "evoral/types.hpp" /** If this is not defined, all methods of MidiEvent are RT safe @@ -35,18 +35,21 @@ namespace Evoral { -event_id_t event_id_counter(); -event_id_t next_event_id(); -void init_event_id_counter(event_id_t n); +LIBEVORAL_API event_id_t event_id_counter(); +LIBEVORAL_API event_id_t next_event_id(); +LIBEVORAL_API void init_event_id_counter(event_id_t n); /** An event (much like a type generic jack_midi_event_t) * * Template parameter Time is the type of the time stamp used for this event. */ template -struct Event { +class LIBEVORAL_API Event { +public: #ifdef EVORAL_EVENT_ALLOC - Event (EventType type=0, Time time=0, uint32_t size=0, uint8_t* buf=NULL, bool alloc=false); + Event (EventType type=0, Time time=Time(), uint32_t size=0, uint8_t* buf=NULL, bool alloc=false); + + Event (EventType type, Time time, uint32_t size, const uint8_t* buf); /** Copy \a copy. * @@ -60,7 +63,7 @@ struct Event { const Event& operator=(const Event& copy); - void set(uint8_t* buf, uint32_t size, Time t); + void set(const uint8_t* buf, uint32_t size, Time t); inline bool operator==(const Event& other) const { if (_type != other._type) @@ -112,11 +115,11 @@ struct Event { } inline void clear() { - _type = 0; - _original_time = 0; - _nominal_time = 0; - _size = 0; - _buf = NULL; + _type = 0; + _original_time = Time(); + _nominal_time = Time(); + _size = 0; + _buf = NULL; } #else @@ -152,11 +155,8 @@ protected: #endif }; -} // namespace Evoral - - template -std::ostream& operator<<(std::ostream& o, const Evoral::Event