From c61373212a87e519276d4c011994e2d37c77ee16 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 8 Nov 2016 20:34:45 -0500 Subject: Support multiple readers for MIDI source/model Fixes the multiple reader issue #6541 properly without resorting to a linear search kludge. All the read state has been pulled out into a MidiCursor which the caller is required to pass. The playlist keeps cursors for all the regions it is reading, any number of cursors are allowed at a time. MidiCursor should probably be made a smarter and more fool-proof object (and/or possibly merged with some of the other tracker/fixer stuff) but for now I wanted to keep it simple. --- libs/ardour/ardour/midi_playlist.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libs/ardour/ardour/midi_playlist.h') diff --git a/libs/ardour/ardour/midi_playlist.h b/libs/ardour/ardour/midi_playlist.h index ad0a812cba..3c031a994f 100644 --- a/libs/ardour/ardour/midi_playlist.h +++ b/libs/ardour/ardour/midi_playlist.h @@ -26,6 +26,7 @@ #include #include "ardour/ardour.h" +#include "ardour/midi_cursor.h" #include "ardour/midi_model.h" #include "ardour/midi_state_tracker.h" #include "ardour/note_fixer.h" @@ -112,12 +113,14 @@ public: protected: void remove_dependents (boost::shared_ptr region); + void region_going_away (boost::weak_ptr region); private: typedef Evoral::Note Note; typedef Evoral::Event Event; struct RegionTracker : public boost::noncopyable { + MidiCursor cursor; ///< Cursor (iterator and read state) MidiStateTracker tracker; ///< Active note tracker NoteFixer fixer; ///< Edit compensation }; -- cgit v1.2.3