diff options
author | David Robillard <d@drobilla.net> | 2014-11-20 15:36:11 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-11-20 15:36:11 -0500 |
commit | 4bc0d1c475f4f8c87b0fea690e5105d31337d6f4 (patch) | |
tree | fe0aed2c39451cfcea385d91166bc43d82a97b74 /libs/ardour/ardour | |
parent | 8bba63282a4d641287d6da945fc7ce49b583038c (diff) |
Fix lost MIDI note offs and controllers.
Fix initial read of discrete MIDI controllers.
Fix spurious note offs when starting to play in the middle of a note.
Faster search for initial event when cached iterator is invalid.
So much for dropping the cached iterator. The iterator is responsible for
handling note offs, so that doesn't work. This design means we have some stuck
note issues at the source read level, but they should be taken care of by the
state tracker anyway.
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/midi_source.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h index 364b220ebb..65e382c4b7 100644 --- a/libs/ardour/ardour/midi_source.h +++ b/libs/ardour/ardour/midi_source.h @@ -140,6 +140,11 @@ class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_sha virtual void load_model(bool lock=true, bool force_reload=false) = 0; virtual void destroy_model() = 0; + /** This must be called with the source lock held whenever the + * source/model contents have been changed (reset iterators/cache/etc). + */ + void invalidate(); + void set_note_mode(NoteMode mode); boost::shared_ptr<MidiModel> model() { return _model; } @@ -186,7 +191,11 @@ class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_sha boost::shared_ptr<MidiModel> _model; bool _writing; - mutable double _length_beats; + mutable Evoral::Sequence<Evoral::MusicalTime>::const_iterator _model_iter; + mutable bool _model_iter_valid; + + mutable double _length_beats; + mutable framepos_t _last_read_end; /** The total duration of the current capture. */ framepos_t _capture_length; |