From 0108f9f18df9273b88c2c2a1f7fecb29926ea04d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 8 May 2015 13:44:24 -0400 Subject: [PATCH] add the Tracks version of Track::monitoring_state() This drastically-stripped down version of the Ardour original is used only when USE_TRACKS_CODE_FEATURES is defined. It doesn't respond to many aspects/features of libardour. --- libs/ardour/session.cc | 1 + libs/ardour/track.cc | 61 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 1ff24a8797..56b8f2b739 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -78,6 +78,7 @@ #include "ardour/plugin.h" #include "ardour/plugin_insert.h" #include "ardour/process_thread.h" +#include "ardour/profile.h" #include "ardour/rc_configuration.h" #include "ardour/recent_sessions.h" #include "ardour/region.h" diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index 92ea993470..2d46c60132 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -930,6 +930,65 @@ Track::adjust_capture_buffering () } } +#ifdef USE_TRACKS_CODE_FEATURES + +/* This is the Tracks version of Track::monitoring_state(). + * + * Ardour developers: try to flag or fix issues if parts of the libardour API + * change in ways that invalidate this + */ + +MonitorState +Track::monitoring_state () const +{ + /* Explicit requests */ + + if (_monitoring & MonitorInput) { + return MonitoringInput; + } + + if (_monitoring & MonitorDisk) { + return MonitoringDisk; + } + + /* This is an implementation of the truth table in doc/monitor_modes.pdf; + I don't think it's ever going to be too pretty too look at. + */ + + // GZ: NOT USED IN TRACKS + //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 const roll = _session.transport_rolling (); + bool const track_rec = _diskstream->record_enabled (); + bool session_rec = _session.actively_recording (); + + if (track_rec) { + + if (!session_rec && roll) { + return MonitoringDisk; + } else { + return MonitoringInput; + } + + } else { + + if (roll) { + return MonitoringDisk; + } + } + + return MonitoringSilence; +} + +#else + +/* This is the Ardour/Mixbus version of Track::monitoring_state(). + * + * Tracks developers: do NOT modify this method under any circumstances. + */ + MonitorState Track::monitoring_state () const { @@ -995,6 +1054,8 @@ Track::monitoring_state () const return MonitoringSilence; } +#endif + void Track::maybe_declick (BufferSet& bufs, framecnt_t nframes, int declick) {