gain controls are supposed to be "gain-like"
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 21 Sep 2016 22:18:48 +0000 (17:18 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 21 Sep 2016 22:18:48 +0000 (17:18 -0500)
libs/ardour/ardour/automation_control.h
libs/ardour/ardour/slavable_automation_control.h
libs/ardour/automation_control.cc
libs/ardour/gain_control.cc
libs/ardour/slavable_automation_control.cc

index e15abbec46ce58f0594b526d696b9b557c169b2c..158996133cdffa23285047855f08792e067cb658 100644 (file)
@@ -58,7 +58,9 @@ class LIBARDOUR_API AutomationControl
                          const Evoral::Parameter&                  parameter,
                          const ParameterDescriptor&                desc,
                          boost::shared_ptr<ARDOUR::AutomationList> l=boost::shared_ptr<ARDOUR::AutomationList>(),
-                         const std::string&                        name="");
+                         const std::string&                        name="",
+                         PBD::Controllable::Flag                   flags=PBD::Controllable::Flag (0)
+               );
 
        ~AutomationControl ();
 
index 45b555595fad2b97c935b56d6c350af69ccf61cd..7e46dd5a74e7995abee60518a399ec09d59497ea 100644 (file)
@@ -29,10 +29,12 @@ class LIBARDOUR_API SlavableAutomationControl : public AutomationControl
 {
     public:
        SlavableAutomationControl(ARDOUR::Session&,
-                         const Evoral::Parameter&                  parameter,
-                         const ParameterDescriptor&                desc,
-                         boost::shared_ptr<ARDOUR::AutomationList> l=boost::shared_ptr<ARDOUR::AutomationList>(),
-                         const std::string&                        name="");
+                                 const Evoral::Parameter&                  parameter,
+                                 const ParameterDescriptor&                desc,
+                                 boost::shared_ptr<ARDOUR::AutomationList> l=boost::shared_ptr<ARDOUR::AutomationList>(),
+                                 const std::string&                        name="",
+                                 PBD::Controllable::Flag                   flags=PBD::Controllable::Flag (0)
+               );
 
        double get_value () const;
 
index e27da6ab08797f30badbec995de59bb33a57b136..9a6590ebe845bd442a7011d5a0e941c2f97246de 100644 (file)
@@ -49,8 +49,10 @@ AutomationControl::AutomationControl(ARDOUR::Session&                          s
                                      const Evoral::Parameter&                  parameter,
                                      const ParameterDescriptor&                desc,
                                      boost::shared_ptr<ARDOUR::AutomationList> list,
-                                     const string&                             name)
-       : Controllable (name.empty() ? EventTypeMap::instance().to_symbol(parameter) : name)
+                                     const string&                             name,
+                                     Controllable::Flag                        flags)
+
+       : Controllable (name.empty() ? EventTypeMap::instance().to_symbol(parameter) : name, flags)
        , Evoral::Control(parameter, desc, list)
        , _session(session)
        , _desc(desc)
@@ -123,7 +125,7 @@ AutomationControl::actually_set_value (double value, PBD::Controllable::GroupCon
        Control::set_double (value, _session.transport_frame(), to_list);
 
        //AutomationType at = (AutomationType) _parameter.type();
-       //std::cerr << "++++ Changed (" << enum_2_string (at) << ", " << enum_2_string (gcd) << ") = " << value 
+       //std::cerr << "++++ Changed (" << enum_2_string (at) << ", " << enum_2_string (gcd) << ") = " << value
        //<< " (was " << old_value << ") @ " << this << std::endl;
 
        Changed (true, gcd);
index 8910c9a98c6b4fafac48905d420e24f4febeec35..d100273640087e372f75dde70bf7b39bfba3c79e 100644 (file)
@@ -35,8 +35,9 @@ using namespace std;
 GainControl::GainControl (Session& session, const Evoral::Parameter &param, boost::shared_ptr<AutomationList> al)
        : SlavableAutomationControl (session, param, ParameterDescriptor(param),
                                     al ? al : boost::shared_ptr<AutomationList> (new AutomationList (param)),
-                                    param.type() == GainAutomation ? X_("gaincontrol") : X_("trimcontrol")) {
-
+                                    param.type() == GainAutomation ? X_("gaincontrol") : X_("trimcontrol"),
+                                    Controllable::GainLike)
+{
        alist()->reset_default (1.0);
 
        lower_db = accurate_coefficient_to_dB (_desc.lower);
index d4002343e881e48909eb37e7c54b0da16e00d4a4..a80598439d3710100c9711a9ebac7df1bc2f83d6 100644 (file)
@@ -32,8 +32,9 @@ SlavableAutomationControl::SlavableAutomationControl(ARDOUR::Session& s,
                                                      const Evoral::Parameter&                  parameter,
                                                      const ParameterDescriptor&                desc,
                                                      boost::shared_ptr<ARDOUR::AutomationList> l,
-                                                     const std::string&                        name)
-       : AutomationControl (s, parameter, desc, l, name)
+                                                     const std::string&                        name,
+                                                     Controllable::Flag                        flags)
+       : AutomationControl (s, parameter, desc, l, name, flags)
 {
 }