From 8de887f378b13e558bdd74e88be79dc96df9d7b4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 29 Feb 2012 03:21:37 +0000 Subject: Update to latest LV2 atom extension. git-svn-id: svn://localhost/ardour2/branches/3.0@11548 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/buffer_set.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libs/ardour/buffer_set.cc') diff --git a/libs/ardour/buffer_set.cc b/libs/ardour/buffer_set.cc index bf114b95d5..156cf4dd3f 100644 --- a/libs/ardour/buffer_set.cc +++ b/libs/ardour/buffer_set.cc @@ -190,8 +190,10 @@ BufferSet::ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capac if (type == DataType::MIDI && _lv2_buffers.size() < _buffers[type].size() * 2 + 1) { while (_lv2_buffers.size() < _buffers[type].size() * 2) { _lv2_buffers.push_back( - std::make_pair(false, - lv2_evbuf_new(buffer_capacity, LV2_EVBUF_EVENT, 0))); + std::make_pair(false, lv2_evbuf_new(buffer_capacity, + LV2_EVBUF_EVENT, + LV2Plugin::_chunk_type, + LV2Plugin::_sequence_type))); } } #endif @@ -251,25 +253,23 @@ BufferSet::get(DataType type, size_t i) const #ifdef LV2_SUPPORT LV2_Evbuf* -BufferSet::get_lv2_midi(bool input, size_t i, uint32_t atom_type) +BufferSet::get_lv2_midi(bool input, size_t i, bool old_api) { assert(count().get(DataType::MIDI) > i); MidiBuffer& mbuf = get_midi(i); LV2Buffers::value_type b = _lv2_buffers.at(i * 2 + (input ? 0 : 1)); LV2_Evbuf* evbuf = b.second; - lv2_evbuf_set_type(evbuf, - atom_type ? LV2_EVBUF_ATOM : LV2_EVBUF_EVENT, - atom_type); + lv2_evbuf_set_type(evbuf, old_api ? LV2_EVBUF_EVENT : LV2_EVBUF_ATOM); - lv2_evbuf_reset(evbuf); + lv2_evbuf_reset(evbuf, input); if (input) { DEBUG_TRACE(PBD::DEBUG::LV2, string_compose("%1 bytes of MIDI waiting @ %2\n", mbuf.size(), (void*) mbuf.data())); LV2_Evbuf_Iterator i = lv2_evbuf_begin(evbuf); - const uint32_t type = LV2Plugin::midi_event_type(atom_type == 0); + const uint32_t type = LV2Plugin::midi_event_type(old_api); for (MidiBuffer::iterator e = mbuf.begin(); e != mbuf.end(); ++e) { const Evoral::MIDIEvent ev(*e, false); #ifndef NDEBUG -- cgit v1.2.3