diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-01-12 14:09:24 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-01-18 12:11:08 -0500 |
commit | d1033819bd09d8a46ec602a586ddba0e10f803d6 (patch) | |
tree | 700a2d051b17f9f9b617166a158909b62045cffe /libs/ardour/ardour/amp.h | |
parent | 19af86ece2d40729348b6ae6cb73d4e370115040 (diff) |
change ownership of the AutomationControl used by Amp.
It used to be owned by Amp. Now it is owned by Amp's owner
Diffstat (limited to 'libs/ardour/ardour/amp.h')
-rw-r--r-- | libs/ardour/ardour/amp.h | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/libs/ardour/ardour/amp.h b/libs/ardour/ardour/amp.h index c92edcc5fc..108694de90 100644 --- a/libs/ardour/ardour/amp.h +++ b/libs/ardour/ardour/amp.h @@ -36,13 +36,11 @@ class IO; */ class LIBARDOUR_API Amp : public Processor { public: - Amp(Session& s, std::string type = "amp"); + Amp(Session& s, const std::string& display_name, boost::shared_ptr<AutomationControl> control, bool control_midi_also); std::string display_name () const { return _display_name; } void set_display_name (const std::string& name) { _display_name = name; } - std::string type() const { return _type;} - bool visible () const; bool can_support_io_configuration (const ChanCount& in, ChanCount& out); @@ -81,16 +79,8 @@ public: /* automation */ struct GainControl : public AutomationControl { - GainControl (std::string name, Session& session, Amp* a, const Evoral::Parameter ¶m, - boost::shared_ptr<AutomationList> al = boost::shared_ptr<AutomationList>() ) - : AutomationControl (session, param, ParameterDescriptor(param), al, name) - , _amp (a) { - set_flags (Controllable::Flag (flags() | Controllable::GainLike)); - alist()->reset_default (1.0); - - lower_db = accurate_coefficient_to_dB (_desc.lower); - range_db = accurate_coefficient_to_dB (_desc.upper) - lower_db; - } + GainControl (Session& session, const Evoral::Parameter ¶m, + boost::shared_ptr<AutomationList> al = boost::shared_ptr<AutomationList>()); void set_value (double val, PBD::Controllable::GroupControlDisposition group_override); void set_value_unchecked (double); @@ -101,17 +91,17 @@ public: double user_to_internal (double) const; std::string get_user_string () const; - Amp* _amp; double lower_db; double range_db; }; + boost::shared_ptr<GainControl> gain_control() { - return _gain_control; + return boost::dynamic_pointer_cast<GainControl> (_gain_control); } boost::shared_ptr<const GainControl> gain_control() const { - return _gain_control; + return boost::dynamic_pointer_cast<GainControl> (_gain_control); } std::string value_as_string (boost::shared_ptr<AutomationControl>) const; @@ -125,11 +115,10 @@ private: std::string _display_name; - boost::shared_ptr<GainControl> _gain_control; + boost::shared_ptr<AutomationControl> _gain_control; /** Buffer that we should use for gain automation */ gain_t* _gain_automation_buffer; - std::string _type; bool _midi_amp; }; |