summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_track.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/midi_track.cc')
-rw-r--r--libs/ardour/midi_track.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc
index d60aba8bbc..662d19df3c 100644
--- a/libs/ardour/midi_track.cc
+++ b/libs/ardour/midi_track.cc
@@ -79,7 +79,7 @@ MidiTrack::MidiTrack (Session& sess, string name, Route::Flag flag, TrackMode mo
}
MidiTrack::MidiTrack (Session& sess, const XMLNode& node)
- : Track (sess, node)
+ : Track (sess, node, DataType::MIDI )
, _immediate_events(1024) // FIXME: size?
, _note_mode(Sustained)
{
@@ -438,6 +438,11 @@ MidiTrack::roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
int dret;
boost::shared_ptr<MidiDiskstream> diskstream = midi_diskstream();
+ // I guess this is the right place to call cycle_start for our ports.
+ // but it actually sucks, to directly mess with the IO.... oh well.
+
+ prepare_inputs( nframes, offset );
+
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
if (lm.locked()) {
@@ -458,6 +463,7 @@ MidiTrack::roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
nframes_t transport_frame = _session.transport_frame();
+
if ((nframes = check_initial_delay (nframes, offset, transport_frame)) == 0) {
/* need to do this so that the diskstream sets its
playback distance to zero, thus causing diskstream::commit
@@ -511,6 +517,8 @@ MidiTrack::roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
}
+ flush_outputs( nframes, offset );
+
return 0;
}