From 5ea862ccc23f0408b513e66519d21e0c77f3986a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 13 Jan 2021 17:34:17 -0700 Subject: [PATCH] fix several more controls to take a time domain from their owner (Automatable) --- libs/ardour/ardour/monitor_control.h | 2 +- libs/ardour/ardour/phase_control.h | 2 +- libs/ardour/ardour/record_safe_control.h | 2 +- libs/ardour/ardour/solo_control.h | 2 +- libs/ardour/automatable.cc | 4 ++-- libs/ardour/monitor_control.cc | 4 ++-- libs/ardour/phase_control.cc | 4 ++-- libs/ardour/record_safe_control.cc | 5 ++--- libs/ardour/route.cc | 4 ++-- libs/ardour/solo_control.cc | 5 ++--- libs/ardour/track.cc | 4 ++-- libs/ardour/vca.cc | 2 +- 12 files changed, 19 insertions(+), 21 deletions(-) diff --git a/libs/ardour/ardour/monitor_control.h b/libs/ardour/ardour/monitor_control.h index 8cd6295228..a79a9a935f 100644 --- a/libs/ardour/ardour/monitor_control.h +++ b/libs/ardour/ardour/monitor_control.h @@ -36,7 +36,7 @@ class Session; class LIBARDOUR_API MonitorControl : public SlavableAutomationControl { public: - MonitorControl (Session& session, std::string const & name, Monitorable& m); + MonitorControl (Session& session, std::string const & name, Monitorable& m, Temporal::TimeDomain); ~MonitorControl() {} MonitorChoice monitoring_choice() const { return static_cast ((int)get_value()); } diff --git a/libs/ardour/ardour/phase_control.h b/libs/ardour/ardour/phase_control.h index feb9aea283..d875a6411c 100644 --- a/libs/ardour/ardour/phase_control.h +++ b/libs/ardour/ardour/phase_control.h @@ -38,7 +38,7 @@ class Session; class LIBARDOUR_API PhaseControl : public AutomationControl { public: - PhaseControl (Session& session, std::string const & name); + PhaseControl (Session& session, std::string const & name, Temporal::TimeDomain); /* There are two approaches to designing/using a PhaseControl. One is * to have one such control for every channel of the control's diff --git a/libs/ardour/ardour/record_safe_control.h b/libs/ardour/ardour/record_safe_control.h index 091074089d..7a88f53342 100644 --- a/libs/ardour/ardour/record_safe_control.h +++ b/libs/ardour/ardour/record_safe_control.h @@ -35,7 +35,7 @@ class Session; class LIBARDOUR_API RecordSafeControl : public SlavableAutomationControl { public: - RecordSafeControl (Session& session, std::string const & name, Recordable& m); + RecordSafeControl (Session& session, std::string const & name, Recordable& m, Temporal::TimeDomain td); ~RecordSafeControl() {} protected: diff --git a/libs/ardour/ardour/solo_control.h b/libs/ardour/ardour/solo_control.h index 47d8a34d6d..812978dd3a 100644 --- a/libs/ardour/ardour/solo_control.h +++ b/libs/ardour/ardour/solo_control.h @@ -35,7 +35,7 @@ class Muteable; class LIBARDOUR_API SoloControl : public SlavableAutomationControl { public: - SoloControl (Session& session, std::string const & name, Soloable& soloable, Muteable& m); + SoloControl (Session& session, std::string const & name, Soloable& soloable, Muteable& m, Temporal::TimeDomain); double get_value () const; double get_save_value() const { return self_soloed(); } diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index 5c47c8134f..ab1c9452cb 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -579,13 +579,13 @@ Automatable::control_factory(const Evoral::Parameter& param) } else if (param.type() == MonitoringAutomation) { Monitorable* m = dynamic_cast(this); if (m) { - control = new MonitorControl (_a_session, X_("monitor"), *m); + control = new MonitorControl (_a_session, X_("monitor"), *m, time_domain()); } } else if (param.type() == SoloAutomation) { Soloable* s = dynamic_cast(this); Muteable* m = dynamic_cast(this); if (s && m) { - control = new SoloControl (_a_session, X_("solo"), *s, *m); + control = new SoloControl (_a_session, X_("solo"), *s, *m, time_domain()); } } else if (param.type() == MuteAutomation) { Muteable* m = dynamic_cast(this); diff --git a/libs/ardour/monitor_control.cc b/libs/ardour/monitor_control.cc index a6bc5988ed..f2426daf3b 100644 --- a/libs/ardour/monitor_control.cc +++ b/libs/ardour/monitor_control.cc @@ -24,9 +24,9 @@ using namespace ARDOUR; using namespace PBD; -MonitorControl::MonitorControl (Session& session, std::string const & name, Monitorable& m) +MonitorControl::MonitorControl (Session& session, std::string const & name, Monitorable& m, Temporal::TimeDomain td) : SlavableAutomationControl (session, MonitoringAutomation, ParameterDescriptor (MonitoringAutomation), - boost::shared_ptr(new AutomationList(Evoral::Parameter(MonitoringAutomation), Temporal::AudioTime)), + boost::shared_ptr(new AutomationList(Evoral::Parameter(MonitoringAutomation), td)), name) , _monitorable (m) diff --git a/libs/ardour/phase_control.cc b/libs/ardour/phase_control.cc index 2c3bc392bb..223520fa01 100644 --- a/libs/ardour/phase_control.cc +++ b/libs/ardour/phase_control.cc @@ -25,9 +25,9 @@ using namespace std; using namespace PBD; using namespace ARDOUR; -PhaseControl::PhaseControl (Session& session, std::string const & name) +PhaseControl::PhaseControl (Session& session, std::string const & name, Temporal::TimeDomain td) : AutomationControl (session, PhaseAutomation, ParameterDescriptor (PhaseAutomation), - boost::shared_ptr(new AutomationList(Evoral::Parameter(PhaseAutomation), Temporal::AudioTime)), + boost::shared_ptr(new AutomationList(Evoral::Parameter(PhaseAutomation), td)), name) { } diff --git a/libs/ardour/record_safe_control.cc b/libs/ardour/record_safe_control.cc index c645f452e3..979e8900b4 100644 --- a/libs/ardour/record_safe_control.cc +++ b/libs/ardour/record_safe_control.cc @@ -24,10 +24,9 @@ using namespace ARDOUR; using namespace PBD; -#warning NUTEMPO question: what is the right time domain here -RecordSafeControl::RecordSafeControl (Session& session, std::string const & name, Recordable& r) +RecordSafeControl::RecordSafeControl (Session& session, std::string const & name, Recordable& r, Temporal::TimeDomain td) : SlavableAutomationControl (session, RecSafeAutomation, ParameterDescriptor (RecSafeAutomation), - boost::shared_ptr(new AutomationList(Evoral::Parameter(RecSafeAutomation), Temporal::AudioTime)), + boost::shared_ptr(new AutomationList(Evoral::Parameter(RecSafeAutomation), td)), name) , _recordable (r) { diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index b231815834..a92771d825 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -165,14 +165,14 @@ Route::init () * Automatable API. -- Don't call add_control () here. */ - _solo_control.reset (new SoloControl (_session, X_("solo"), *this, *this)); + _solo_control.reset (new SoloControl (_session, X_("solo"), *this, *this, time_domain())); add_control (_solo_control); _solo_control->Changed.connect_same_thread (*this, boost::bind (&Route::solo_control_changed, this, _1, _2)); _mute_control.reset (new MuteControl (_session, X_("mute"), *this, time_domain())); add_control (_mute_control); - _phase_control.reset (new PhaseControl (_session, X_("phase"))); + _phase_control.reset (new PhaseControl (_session, X_("phase"), time_domain())); add_control (_phase_control); _solo_isolate_control.reset (new SoloIsolateControl (_session, X_("solo-iso"), *this, time_domain())); diff --git a/libs/ardour/solo_control.cc b/libs/ardour/solo_control.cc index 88a2b884cc..dc0c0dd492 100644 --- a/libs/ardour/solo_control.cc +++ b/libs/ardour/solo_control.cc @@ -28,10 +28,9 @@ using namespace ARDOUR; using namespace std; using namespace PBD; -#warning NUTEMPO QUESTION what time domain shoudl this really use? -SoloControl::SoloControl (Session& session, std::string const & name, Soloable& s, Muteable& m) +SoloControl::SoloControl (Session& session, std::string const & name, Soloable& s, Muteable& m, Temporal::TimeDomain td) : SlavableAutomationControl (session, SoloAutomation, ParameterDescriptor (SoloAutomation), - boost::shared_ptr(new AutomationList(Evoral::Parameter(SoloAutomation), Temporal::AudioTime)), + boost::shared_ptr(new AutomationList(Evoral::Parameter(SoloAutomation), td)), name) , _soloable (s) , _muteable (m) diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index ff0f2ff323..b255dde12a 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -107,10 +107,10 @@ Track::init () _record_enable_control.reset (new RecordEnableControl (_session, EventTypeMap::instance().to_symbol (RecEnableAutomation), *this, time_domain())); add_control (_record_enable_control); - _record_safe_control.reset (new RecordSafeControl (_session, EventTypeMap::instance().to_symbol (RecSafeAutomation), *this)); + _record_safe_control.reset (new RecordSafeControl (_session, EventTypeMap::instance().to_symbol (RecSafeAutomation), *this, time_domain())); add_control (_record_safe_control); - _monitoring_control.reset (new MonitorControl (_session, EventTypeMap::instance().to_symbol (MonitoringAutomation), *this)); + _monitoring_control.reset (new MonitorControl (_session, EventTypeMap::instance().to_symbol (MonitoringAutomation), *this, time_domain())); add_control (_monitoring_control); if (!name().empty()) { diff --git a/libs/ardour/vca.cc b/libs/ardour/vca.cc index 232b7d629d..3574ba8549 100644 --- a/libs/ardour/vca.cc +++ b/libs/ardour/vca.cc @@ -79,7 +79,7 @@ VCA::VCA (Session& s, int32_t num, const string& name) int VCA::init () { - _solo_control.reset (new SoloControl (_session, X_("solo"), *this, *this)); + _solo_control.reset (new SoloControl (_session, X_("solo"), *this, *this, time_domain())); _mute_control.reset (new MuteControl (_session, X_("mute"), *this, time_domain())); add_control (_gain_control);