summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/midi_source.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-11-20 15:36:11 -0500
committerDavid Robillard <d@drobilla.net>2014-11-20 15:36:11 -0500
commit4bc0d1c475f4f8c87b0fea690e5105d31337d6f4 (patch)
treefe0aed2c39451cfcea385d91166bc43d82a97b74 /libs/ardour/ardour/midi_source.h
parent8bba63282a4d641287d6da945fc7ce49b583038c (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/midi_source.h')
-rw-r--r--libs/ardour/ardour/midi_source.h11
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;