From a2d2f738cb63dbf0fb89e0a00c424ce883fb7888 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 22 Sep 2008 16:28:02 +0000 Subject: Move event specific ringbuffer stuff to evoral. Sane event type interface between evoral and libardour (no more shared magic numbers). Cleanup Evoral::Sequence iterator, fix bugs, probably introduce new ones. Move MIDI specific event functions to Evoral::MIDIEvent (is-a Evoral::Event). git-svn-id: svn://localhost/ardour2/branches/3.0@3785 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/midi_buffer.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libs/ardour/ardour/midi_buffer.h') diff --git a/libs/ardour/ardour/midi_buffer.h b/libs/ardour/ardour/midi_buffer.h index 0c13199825..606cbd0ec8 100644 --- a/libs/ardour/ardour/midi_buffer.h +++ b/libs/ardour/ardour/midi_buffer.h @@ -39,7 +39,7 @@ public: void copy(const MidiBuffer& copy); - bool push_back(const Evoral::Event& event); + bool push_back(const Evoral::MIDIEvent& event); bool push_back(const jack_midi_event_t& event); uint8_t* reserve(double time, size_t size); @@ -50,7 +50,7 @@ public: struct iterator { iterator(MidiBuffer& b, size_t i) : buffer(b), index(i) {} - inline Evoral::Event& operator*() const { return buffer[index]; } + inline Evoral::MIDIEvent& operator*() const { return buffer[index]; } inline iterator& operator++() { ++index; return *this; } // prefix inline bool operator!=(const iterator& other) const { return index != other.index; } @@ -61,7 +61,7 @@ public: struct const_iterator { const_iterator(const MidiBuffer& b, size_t i) : buffer(b), index(i) {} - inline const Evoral::Event& operator*() const { return buffer[index]; } + inline const Evoral::MIDIEvent& operator*() const { return buffer[index]; } inline const_iterator& operator++() { ++index; return *this; } // prefix inline bool operator!=(const const_iterator& other) const { return index != other.index; } @@ -80,8 +80,8 @@ private: friend class iterator; friend class const_iterator; - const Evoral::Event& operator[](size_t i) const { assert(i < _size); return _events[i]; } - Evoral::Event& operator[](size_t i) { assert(i < _size); return _events[i]; } + const Evoral::MIDIEvent& operator[](size_t i) const { assert(i < _size); return _events[i]; } + Evoral::MIDIEvent& operator[](size_t i) { assert(i < _size); return _events[i]; } // FIXME: Eliminate this static const size_t MAX_EVENT_SIZE = 4; // bytes @@ -92,8 +92,8 @@ private: /* FIXME: this is utter crap. rewrite as a flat/packed buffer like MidiRingBuffer */ - Evoral::Event* _events; ///< Event structs that point to offsets in _data - uint8_t* _data; ///< MIDI, straight up. No time stamps. + Evoral::MIDIEvent* _events; ///< Event structs that point to offsets in _data + uint8_t* _data; ///< MIDI, straight up. No time stamps. }; -- cgit v1.2.3