diff options
author | David Robillard <d@drobilla.net> | 2009-02-15 01:24:26 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-02-15 01:24:26 +0000 |
commit | 5a48f99f72c2e2f3ed313e00446dfdaa05dc5d56 (patch) | |
tree | c67b0c1a4da8dde5146e21b6699d15f389041e68 /libs/ardour/ardour/midi_source.h | |
parent | aefa9f0938d287c497878a6e29ce2f9e0bade7c5 (diff) |
Use nframes_t for timestamps of real (jack) time MIDI events (i.e. in MidiBuffer and MidiRingBuffer).
Use iterator interface of Sequence to read events in a MIDISource rather than Sequence::read, avoiding timestamp confusion.
Disable no longer useful Sequence::read.
git-svn-id: svn://localhost/ardour2/branches/3.0@4570 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/midi_source.h')
-rw-r--r-- | libs/ardour/ardour/midi_source.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h index c0b105decd..2126b4b162 100644 --- a/libs/ardour/ardour/midi_source.h +++ b/libs/ardour/ardour/midi_source.h @@ -57,8 +57,8 @@ class MidiSource : public Source virtual uint32_t n_channels () const { return 1; } // FIXME: integrate this with the Readable::read interface somehow - virtual nframes_t midi_read (MidiRingBuffer<TimeType>& dst, nframes_t start, nframes_t cnt, nframes_t stamp_offset, nframes_t negative_stamp_offset) const; - virtual nframes_t midi_write (MidiRingBuffer<TimeType>& src, nframes_t cnt); + virtual nframes_t midi_read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t cnt, nframes_t stamp_offset, nframes_t negative_stamp_offset) const; + virtual nframes_t midi_write (MidiRingBuffer<nframes_t>& src, nframes_t cnt); virtual void append_event_unlocked(EventTimeUnit unit, const Evoral::Event<TimeType>& ev) = 0; @@ -98,11 +98,9 @@ class MidiSource : public Source protected: virtual void flush_midi() = 0; - //virtual int flush_header() = 0; - //virtual int flush_footer() = 0; - virtual nframes_t read_unlocked (MidiRingBuffer<TimeType>& dst, nframes_t start, nframes_t cnt, nframes_t stamp_offset, nframes_t negative_stamp_offset) const = 0; - virtual nframes_t write_unlocked (MidiRingBuffer<TimeType>& dst, nframes_t cnt) = 0; + virtual nframes_t read_unlocked (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t cnt, nframes_t stamp_offset, nframes_t negative_stamp_offset) const = 0; + virtual nframes_t write_unlocked (MidiRingBuffer<nframes_t>& dst, nframes_t cnt) = 0; mutable Glib::Mutex _lock; string _captured_for; @@ -112,6 +110,9 @@ class MidiSource : public Source boost::shared_ptr<MidiModel> _model; bool _writing; + + mutable Evoral::Sequence<double>::const_iterator _model_iter; + mutable nframes_t _last_read_end; private: bool file_changed (string path); |