diff options
author | David Robillard <d@drobilla.net> | 2009-05-04 15:50:51 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-05-04 15:50:51 +0000 |
commit | ca10cc82a4374a5b413c06ead6cc89c53f8881ee (patch) | |
tree | 3d44716ed02d80bd1256609631c77a730d04e169 /libs/ardour/ardour/buffer_set.h | |
parent | 9b06b1da0cec57a6848cf1f7920691ae022b30e7 (diff) |
Preliminary MIDI plugin support.
git-svn-id: svn://localhost/ardour2/branches/3.0@5036 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/buffer_set.h')
-rw-r--r-- | libs/ardour/ardour/buffer_set.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libs/ardour/ardour/buffer_set.h b/libs/ardour/ardour/buffer_set.h index f02470c3e8..72f45762c7 100644 --- a/libs/ardour/ardour/buffer_set.h +++ b/libs/ardour/ardour/buffer_set.h @@ -31,6 +31,7 @@ class Buffer; class AudioBuffer; class MidiBuffer; class PortSet; +class LV2EventBuffer; /** A set of buffers of various types. * @@ -55,7 +56,6 @@ public: void attach_buffers(PortSet& ports, nframes_t nframes, nframes_t offset = 0); - void ensure_buffers(const ChanCount& count, size_t buffer_capacity); void ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capacity); const ChanCount& available() const { return _available; } @@ -68,10 +68,7 @@ public: size_t buffer_capacity(DataType type) const; - Buffer& get(DataType type, size_t i) { - assert(i <= _count.get(type)); - return *_buffers[type][i]; - } + Buffer& get(DataType type, size_t i); AudioBuffer& get_audio(size_t i) { return (AudioBuffer&)get(DataType::AUDIO, i); @@ -81,6 +78,14 @@ public: return (MidiBuffer&)get(DataType::MIDI, i); } + /** Get a MIDI buffer translated into an LV2 MIDI buffer for use with plugins. + * The index here corresponds directly to MIDI buffer numbers (i.e. the index + * passed to get_midi), translation back and forth will happen as needed */ + LV2EventBuffer& get_lv2_midi(bool input, size_t i); + + /** Flush modified LV2 event output buffers back to Ardour buffers */ + void flush_lv2_midi(bool input, size_t i); + void read_from(BufferSet& in, nframes_t nframes); // ITERATORS @@ -137,6 +142,11 @@ private: /// Vector of vectors, indexed by DataType std::vector<BufferVec> _buffers; + + /// LV2 MIDI buffers (for conversion to/from MIDI buffers) + // + typedef std::vector< std::pair<bool, LV2EventBuffer*> > LV2Buffers; + LV2Buffers _lv2_buffers; /// Use counts (there may be more actual buffers than this) ChanCount _count; |