diff options
author | David Robillard <d@drobilla.net> | 2006-08-16 20:36:14 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-08-16 20:36:14 +0000 |
commit | 7250433f50236a05fc652fa41c23bf53fbf6a0fd (patch) | |
tree | 0371dfe1b6ce5a9eb1769d10505a6ca658ca1a7b /libs/ardour/ardour/buffer.h | |
parent | 5952c48a848926edb02b5d630e36cc461c893964 (diff) |
Progress on the disk side of things:
- MidiRingBuffer implementation
- MidiDiskstream reading from playlists
- MidiPlaylist reading from regions
- MidiRegions returning random notes for the time being, but the inter-thread stuff works..
Horrible awful mess, not really commit worthy, but I need to move machines.
Nothing to see here.. :)
git-svn-id: svn://localhost/ardour2/branches/midi@835 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/buffer.h')
-rw-r--r-- | libs/ardour/ardour/buffer.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h index df7f57455b..896d6e7616 100644 --- a/libs/ardour/ardour/buffer.h +++ b/libs/ardour/ardour/buffer.h @@ -181,23 +181,36 @@ public: ~MidiBuffer(); - // FIXME: clear events starting at offset in time - void silence(jack_nframes_t len, jack_nframes_t offset=0) { assert(offset == 0); _size = 0; } + void silence(jack_nframes_t dur, jack_nframes_t offset=0); void read_from(const Buffer& src, jack_nframes_t nframes, jack_nframes_t offset); - void set_size(size_t size) { _size = size; } + bool push_back(const MidiEvent& event); + + const MidiEvent& operator[](size_t i) const { assert(i < _size); return _events[i]; } + MidiEvent& operator[](size_t i) { assert(i < _size); return _events[i]; } + + static size_t max_event_size() { return MAX_EVENT_SIZE; } + + //void set_size(size_t size) { _size = size; } - const RawMidi* data() const { return _data; } - RawMidi* data() { return _data; } + //const RawMidi* data() const { return _data; } + //RawMidi* data() { return _data; } private: // These are undefined (prevent copies) MidiBuffer(const MidiBuffer& copy); MidiBuffer& operator=(const MidiBuffer& copy); - bool _owns_data; - RawMidi* _data; ///< Actual buffer contents + // FIXME: Jack needs to tell us this + static const size_t MAX_EVENT_SIZE = 4; // bytes + + /* We use _size as "number of events", so the size of _data is + * (_size * MAX_EVENT_SIZE) + */ + + MidiEvent* _events; ///< Event structs that point to offsets in _data + RawMidi* _data; ///< MIDI, straight up. No time stamps. }; } // namespace ARDOUR |