Re-implement URIMap to tolerate broken plugins that use the wrong context to
[ardour.git] / libs / ardour / ardour / midi_diskstream.h
index 65008714123b2f4be47fdcb546a76c7d1f7dd174..23ae7addb0e9a06f900f504aeb2e7c1a28ad7847 100644 (file)
@@ -65,6 +65,8 @@ class MidiDiskstream : public Diskstream
        void get_playback (MidiBuffer& dst, framecnt_t);
 
        void set_record_enabled (bool yn);
+       
+       void reset_tracker ();
 
        boost::shared_ptr<MidiPlaylist> midi_playlist () { return boost::dynamic_pointer_cast<MidiPlaylist>(_playlist); }
 
@@ -78,7 +80,7 @@ class MidiDiskstream : public Diskstream
        XMLNode& get_state(void);
        int set_state(const XMLNode&, int version);
 
-       void monitor_input (bool);
+       void ensure_jack_monitors_input (bool);
 
        boost::shared_ptr<SMFSource> write_source ()    { return _write_source; }
 
@@ -110,10 +112,12 @@ class MidiDiskstream : public Diskstream
        }
 
        /** Emitted when some MIDI data has been received for recording.
-        *  First parameter is the data.
-        *  Second parameter is the source that it is destined for.
+        *  Parameter is the source that it is destined for.
+        *  A caller can get a copy of the data with get_gui_feed_buffer ()
         */
-       PBD::Signal2<void, boost::shared_ptr<MidiBuffer>, boost::weak_ptr<MidiSource> > DataRecorded;
+       PBD::Signal1<void, boost::weak_ptr<MidiSource> > DataRecorded;
+
+       boost::shared_ptr<MidiBuffer> get_gui_feed_buffer () const;
 
   protected:
        friend class Session;
@@ -189,6 +193,12 @@ class MidiDiskstream : public Diskstream
        NoteMode                     _note_mode;
        volatile gint                _frames_written_to_ringbuffer;
        volatile gint                _frames_read_from_ringbuffer;
+
+       /** A buffer that we use to put newly-arrived MIDI data in for
+           the GUI to read (so that it can update itself).
+       */
+       MidiBuffer                   _gui_feed_buffer;
+       mutable Glib::Mutex          _gui_feed_buffer_mutex;
 };
 
 }; /* namespace ARDOUR */