diff options
author | Robin Gareus <robin@gareus.org> | 2013-06-03 00:48:17 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2013-06-03 00:48:17 +0200 |
commit | a1d0093bfad3bcb297a41e70c2bb343bb796bbae (patch) | |
tree | db002165cfa8c4f20d322d96015425d26a85d7a6 /libs/ardour/buffer_set.cc | |
parent | 7ab25697d27fc1fdb9701b57eac75c1623a594e5 (diff) |
honor LV2 rsz:minimumSize for Atom Event buffers
Diffstat (limited to 'libs/ardour/buffer_set.cc')
-rw-r--r-- | libs/ardour/buffer_set.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/ardour/buffer_set.cc b/libs/ardour/buffer_set.cc index c231a8f402..184e23d1af 100644 --- a/libs/ardour/buffer_set.cc +++ b/libs/ardour/buffer_set.cc @@ -252,6 +252,25 @@ BufferSet::get(DataType type, size_t i) const #ifdef LV2_SUPPORT +void +BufferSet::ensure_lv2_bufsize(bool input, size_t i, size_t buffer_capacity) +{ + assert(count().get(DataType::MIDI) > i); + + LV2Buffers::value_type b = _lv2_buffers.at(i * 2 + (input ? 0 : 1)); + LV2_Evbuf* evbuf = b.second; + + if (lv2_evbuf_get_capacity(evbuf) >= buffer_capacity) return; + + lv2_evbuf_free(b.second); + _lv2_buffers.at(i * 2 + (input ? 0 : 1)) = + std::make_pair(false, lv2_evbuf_new( + buffer_capacity, + LV2_EVBUF_EVENT, + LV2Plugin::urids.atom_Chunk, + LV2Plugin::urids.atom_Sequence)); +} + LV2_Evbuf* BufferSet::get_lv2_midi(bool input, size_t i, bool old_api) { |