promote Playlist::RegionList to ARDOUR::RegionList; fix timefx on multiple regions...
[ardour.git] / libs / ardour / ardour / midi_diskstream.h
index 0454b55e011116ec8af9bb98c8757a0bc52e86e2..23ae7addb0e9a06f900f504aeb2e7c1a28ad7847 100644 (file)
@@ -62,9 +62,11 @@ class MidiDiskstream : public Diskstream
        float playback_buffer_load() const;
        float capture_buffer_load() const;
 
-       void get_playback(MidiBuffer& dst, framepos_t start, framepos_t end);
+       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;
@@ -142,7 +146,7 @@ class MidiDiskstream : public Diskstream
   protected:
        friend class MidiTrack;
 
-       int  process (framepos_t transport_frame, pframes_t nframes, bool& need_butler);
+       int  process (framepos_t transport_frame, pframes_t nframes, framecnt_t &);
        bool commit  (framecnt_t nframes);
        static framecnt_t midi_readahead;
 
@@ -184,11 +188,17 @@ class MidiDiskstream : public Diskstream
 
        MidiRingBuffer<framepos_t>*  _playback_buf;
        MidiRingBuffer<framepos_t>*  _capture_buf;
-       MidiPort*                    _source_port;
+       boost::weak_ptr<MidiPort>    _source_port;
        boost::shared_ptr<SMFSource> _write_source;
        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 */