fix several more controls to take a time domain from their owner (Automatable)

This commit is contained in:
Paul Davis 2021-01-13 17:34:17 -07:00
parent df37c62e37
commit 5ea862ccc2
12 changed files with 19 additions and 21 deletions

View file

@ -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<MonitorChoice> ((int)get_value()); }

View file

@ -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

View file

@ -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:

View file

@ -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(); }

View file

@ -579,13 +579,13 @@ Automatable::control_factory(const Evoral::Parameter& param)
} else if (param.type() == MonitoringAutomation) {
Monitorable* m = dynamic_cast<Monitorable*>(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<Soloable*>(this);
Muteable* m = dynamic_cast<Muteable*>(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<Muteable*>(this);

View file

@ -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<AutomationList>(new AutomationList(Evoral::Parameter(MonitoringAutomation), Temporal::AudioTime)),
boost::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(MonitoringAutomation), td)),
name)
, _monitorable (m)

View file

@ -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<AutomationList>(new AutomationList(Evoral::Parameter(PhaseAutomation), Temporal::AudioTime)),
boost::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(PhaseAutomation), td)),
name)
{
}

View file

@ -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<AutomationList>(new AutomationList(Evoral::Parameter(RecSafeAutomation), Temporal::AudioTime)),
boost::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(RecSafeAutomation), td)),
name)
, _recordable (r)
{

View file

@ -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()));

View file

@ -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<AutomationList>(new AutomationList(Evoral::Parameter(SoloAutomation), Temporal::AudioTime)),
boost::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(SoloAutomation), td)),
name)
, _soloable (s)
, _muteable (m)

View file

@ -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()) {

View file

@ -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);