X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Ftrack.cc;h=57239cb841a35201f9d9438bdee416e984978e3f;hb=caac41a9cb2d86985595c590b151b0197b7b0c4c;hp=b88cc0480ad02ab3e8f8eb5c74427492bd4f9673;hpb=9a25fcbfe13f56665beb93a7f248f7ba8eeaa580;p=ardour.git diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index b88cc0480a..57239cb841 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -347,6 +347,9 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, if (!_active) { silence (nframes); + if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) { + _meter->reset(); + } return 0; } @@ -395,6 +398,9 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, case MonitoringInput: be_silent = false; break; + default: + be_silent = false; + break; } } @@ -405,15 +411,47 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, if (be_silent) { if (_meter_point == MeterInput) { - /* still need input monitoring */ - _input->process_input (_meter, start_frame, end_frame, nframes); + /* still need input monitoring and metering */ + + bool const track_rec = _diskstream->record_enabled (); + bool const auto_input = _session.config.get_auto_input (); + bool const software_monitor = Config->get_monitoring_model() == SoftwareMonitoring; + bool const tape_machine_mode = Config->get_tape_machine_mode (); + bool no_meter = false; + + /* this needs a proper K-map + * and should be separated into a function similar to monitoring_state() + * that also handles roll() states in audio_track.cc, midi_track.cc and route.cc + * + * see http://www.oofus.co.uk/ardour/Ardour3MonitorModesV3.pdf + */ + if (!auto_input && !track_rec) { + no_meter=true; + } + else if (tape_machine_mode && !track_rec && auto_input) { + no_meter=true; + } + else if (!software_monitor && tape_machine_mode && !track_rec) { + no_meter=true; + } + else if (!software_monitor && !tape_machine_mode && !track_rec && !auto_input) { + no_meter=true; + } + + if (no_meter) { + BufferSet& bufs (_session.get_silent_buffers (n_process_buffers())); + _meter->run (bufs, 0, 0, nframes, true); + _input->process_input (boost::shared_ptr(), start_frame, end_frame, nframes); + } else { + _input->process_input (_meter, start_frame, end_frame, nframes); + } } passthru_silence (start_frame, end_frame, nframes, 0); } else { - 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); @@ -439,6 +477,10 @@ Track::silent_roll (pframes_t nframes, framepos_t /*start_frame*/, framepos_t /* { Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); if (!lm.locked()) { + framecnt_t playback_distance = _diskstream->calculate_playback_distance(nframes); + if (can_internal_playback_seek(playback_distance)) { + internal_playback_seek(playback_distance); + } return 0; } @@ -458,7 +500,7 @@ Track::silent_roll (pframes_t nframes, framepos_t /*start_frame*/, framepos_t /* framecnt_t playback_distance; - BufferSet& bufs (_session.get_silent_buffers (n_process_buffers())); + BufferSet& bufs (_session.get_route_buffers (n_process_buffers(), true)); int const dret = _diskstream->process (bufs, _session.transport_frame(), nframes, playback_distance, false); need_butler = _diskstream->commit (playback_distance); @@ -508,15 +550,15 @@ Track::playlist () } void -Track::request_jack_monitors_input (bool m) +Track::request_input_monitoring (bool m) { - _diskstream->request_jack_monitors_input (m); + _diskstream->request_input_monitoring (m); } void -Track::ensure_jack_monitors_input (bool m) +Track::ensure_input_monitoring (bool m) { - _diskstream->ensure_jack_monitors_input (m); + _diskstream->ensure_input_monitoring (m); } bool @@ -948,7 +990,7 @@ Track::metering_state () const bool rv; if (_session.transport_rolling ()) { // audio_track.cc || midi_track.cc roll() runs meter IFF: - rv = _meter_point == MeterInput && (_monitoring & MonitorInput); + rv = _meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled()); } else { // track no_roll() always metering if rv = _meter_point == MeterInput;