diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-03-26 19:01:12 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-03-26 19:01:12 +0000 |
commit | ea9979b4b9b2b0b5d3b50b58b518b0562198fefb (patch) | |
tree | 74608202cc90b520b492405470abff5d99cac9e7 /libs/ardour/ardour/midi_ring_buffer.h | |
parent | e25bff1a346993d39baf2d523b1e247227866362 (diff) |
remove Evoral::RingBuffer, which was (a) duplicating PBD::RingBufferNPT and (b) broken; replace it with PBD::RingBufferNPT
git-svn-id: svn://localhost/ardour2/branches/3.0@9212 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/midi_ring_buffer.h')
-rw-r--r-- | libs/ardour/ardour/midi_ring_buffer.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libs/ardour/ardour/midi_ring_buffer.h b/libs/ardour/ardour/midi_ring_buffer.h index a809226a30..c9bd4db16e 100644 --- a/libs/ardour/ardour/midi_ring_buffer.h +++ b/libs/ardour/ardour/midi_ring_buffer.h @@ -51,7 +51,7 @@ public: inline bool read_contents(uint32_t size, uint8_t* buf); size_t read(MidiBuffer& dst, framepos_t start, framepos_t end, framecnt_t offset=0); - void dump(std::ostream& dst); + // void dump(std::ostream& dst); /** Set the channel filtering mode. * @param mask If mode is FilterChannels, each bit represents a midi channel: @@ -92,13 +92,19 @@ template<typename T> inline bool MidiRingBuffer<T>::read_prefix(T* time, Evoral::EventType* type, uint32_t* size) { - bool success = Evoral::EventRingBuffer<T>::full_read(sizeof(T), (uint8_t*)time); - if (success) - success = Evoral::EventRingBuffer<T>::full_read(sizeof(Evoral::EventType), (uint8_t*)type); - if (success) - success = Evoral::EventRingBuffer<T>::full_read(sizeof(uint32_t), (uint8_t*)size); + if (PBD::RingBufferNPT<uint8_t>::read((uint8_t*)time, sizeof(T)) != sizeof (T)) { + return false; + } + + if (PBD::RingBufferNPT<uint8_t>::read((uint8_t*)type, sizeof(Evoral::EventType)) != sizeof (Evoral::EventType)) { + return false; + } + + if (PBD::RingBufferNPT<uint8_t>::read((uint8_t*)size, sizeof(uint32_t)) != sizeof (uint32_t)) { + return false; + } - return success; + return true; } @@ -109,7 +115,7 @@ template<typename T> inline bool MidiRingBuffer<T>::read_contents(uint32_t size, uint8_t* buf) { - return Evoral::EventRingBuffer<T>::full_read(size, buf); + return PBD::RingBufferNPT<uint8_t>::read(buf, size) == size; } |