X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fmidi_track.cc;h=6a998de90e42b1c1565a3fbf938b4dcd03836ab6;hb=1b24aad933a850f61d7442778134a001b2002ec2;hp=c7768c7249d3f6a3506cb7f5ec6a55b5b1a87658;hpb=c456166dd163e12053c7cfd4554f695ab0d30b68;p=ardour.git diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index c7768c7249..6a998de90e 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -17,8 +17,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include // for ffs(3) - +#include "pbd/ffs.h" #include "pbd/enumwriter.h" #include "pbd/convert.h" #include "evoral/midi_util.h" @@ -319,6 +318,12 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame { Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); if (!lm.locked()) { + boost::shared_ptr diskstream = midi_diskstream(); + framecnt_t playback_distance = diskstream->calculate_playback_distance(nframes); + if (can_internal_playback_seek(llabs(playback_distance))) { + /* TODO should declick, and/or note-off */ + internal_playback_seek(playback_distance); + } return 0; } @@ -353,7 +358,7 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame return dret; } - BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers()); + BufferSet& bufs = _session.get_route_buffers (n_process_buffers()); fill_buffers_with_input (bufs, _input, nframes); @@ -507,7 +512,7 @@ MidiTrack::filter_channels (BufferSet& bufs, ChannelMode mode, uint32_t mask) } break; case ForceChannel: - ev.set_channel (ffs (mask) - 1); + ev.set_channel (PBD::ffs (mask) - 1); ++e; break; case AllChannels: @@ -627,9 +632,9 @@ void MidiTrack::MidiControl::set_value(double val) { bool valid = false; - if (std::isinf(val)) { + if (isinf(val)) { cerr << "MIDIControl value is infinity" << endl; - } else if (std::isnan(val)) { + } else if (isnan(val)) { cerr << "MIDIControl value is NaN" << endl; } else if (val < _list->parameter().min()) { cerr << "MIDIControl value is < " << _list->parameter().min() << endl;