Clarify stop-at-session-end behaviour; should fix #4033.
[ardour.git] / libs / ardour / midi_track.cc
index 238e616a4f2343e48710314c798fd07f1eef170e..ff9810629fc1b591ccfb6787cf9f659f6d9f2afa 100644 (file)
@@ -122,7 +122,7 @@ MidiTrack::set_diskstream (boost::shared_ptr<Diskstream> ds)
        boost::shared_ptr<MidiDiskstream> mds = boost::dynamic_pointer_cast<MidiDiskstream> (ds);
        mds->DataRecorded.connect_same_thread (
                _diskstream_data_recorded_connection,
-               boost::bind (&MidiTrack::diskstream_data_recorded, this, _1, _2));
+               boost::bind (&MidiTrack::diskstream_data_recorded, this, _1));
 
        DiskstreamChanged (); /* EMIT SIGNAL */
 }
@@ -135,16 +135,10 @@ MidiTrack::midi_diskstream() const
 
 int
 MidiTrack::set_state (const XMLNode& node, int version)
-{
-       return _set_state (node, version);
-}
-
-int
-MidiTrack::_set_state (const XMLNode& node, int version)
 {
        const XMLProperty *prop;
 
-       if (Track::_set_state (node, version)) {
+       if (Track::set_state (node, version)) {
                return -1;
        }
 
@@ -358,7 +352,7 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
                c.set_midi (1);
                bufs.set_count (c);
 
-               diskstream->get_playback (mbuf, start_frame, end_frame);
+               diskstream->get_playback (mbuf, nframes);
 
                /* append immediate messages to the first MIDI buffer (thus sending it to the first output port) */
 
@@ -366,9 +360,10 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
 
                /* final argument: don't waste time with automation if we're recording or we've just stopped (yes it can happen) */
 
-               process_output_buffers (bufs, start_frame, end_frame, nframes,
-                                       (!_session.get_record_enabled() || !Config->get_do_not_record_plugins()), declick,
-                                       (!diskstream->record_enabled() && !_session.transport_stopped()));
+               process_output_buffers (
+                       bufs, start_frame, end_frame, nframes,
+                       declick, (!diskstream->record_enabled() && !_session.transport_stopped())
+                       );
        }
 
        for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
@@ -654,9 +649,9 @@ MidiTrack::midi_playlist ()
 }
 
 void
-MidiTrack::diskstream_data_recorded (boost::shared_ptr<MidiBuffer> buf, boost::weak_ptr<MidiSource> src)
+MidiTrack::diskstream_data_recorded (boost::weak_ptr<MidiSource> src)
 {
-       DataRecorded (buf, src); /* EMIT SIGNAL */
+       DataRecorded (src); /* EMIT SIGNAL */
 }
 
 bool
@@ -717,3 +712,9 @@ MidiTrack::diskstream_factory (XMLNode const & node)
 {
        return boost::shared_ptr<Diskstream> (new MidiDiskstream (_session, node));
 }
+
+boost::shared_ptr<MidiBuffer>
+MidiTrack::get_gui_feed_buffer () const
+{
+       return midi_diskstream()->get_gui_feed_buffer ();
+}