diff options
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audio_buffer.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/buffer.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_buffer.h | 10 |
3 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/ardour/audio_buffer.h b/libs/ardour/ardour/audio_buffer.h index c9aefc3903..57c5de6124 100644 --- a/libs/ardour/ardour/audio_buffer.h +++ b/libs/ardour/ardour/audio_buffer.h @@ -157,6 +157,7 @@ public: */ void resize (size_t nframes); + bool empty() const { return _size == 0; } const Sample* data (framecnt_t offset = 0) const { assert(offset <= _capacity); diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h index 4775f24e95..15e97ccc10 100644 --- a/libs/ardour/ardour/buffer.h +++ b/libs/ardour/ardour/buffer.h @@ -56,6 +56,9 @@ public: /** Amount of valid data in buffer. Use this over capacity almost always. */ size_t size() const { return _size; } + /** Return true if the buffer contains no data, false otherwise */ + virtual bool empty() const { return _size == 0; } + /** Type of this buffer. * Based on this you can static cast a Buffer* to the desired type. */ DataType type() const { return _type; } diff --git a/libs/ardour/ardour/midi_buffer.h b/libs/ardour/ardour/midi_buffer.h index 5db64a50fb..611e890304 100644 --- a/libs/ardour/ardour/midi_buffer.h +++ b/libs/ardour/ardour/midi_buffer.h @@ -83,6 +83,9 @@ public: inline bool operator!=(const iterator_base<BufferType, EventType>& other) const { return (&buffer != &other.buffer) || (offset != other.offset); } + inline bool operator==(const iterator_base<BufferType, EventType>& other) const { + return (&buffer == &other.buffer) && (offset == other.offset); + } BufferType& buffer; size_t offset; }; @@ -98,6 +101,13 @@ public: uint8_t* data() const { return _data; } + /** + * returns true if the message with the second argument as its MIDI + * status byte should preceed the message with the first argument as + * its MIDI status byte. + */ + static bool second_simultaneous_midi_byte_is_first (uint8_t, uint8_t); + private: friend class iterator_base< MidiBuffer, Evoral::MIDIEvent<TimeType> >; friend class iterator_base< const MidiBuffer, const Evoral::MIDIEvent<TimeType> >; |