clear up some stupid thinking in Amp regarding the way the underlying AutomationContr...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 19 Feb 2014 17:51:32 +0000 (12:51 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 19 Feb 2014 18:22:52 +0000 (13:22 -0500)
libs/ardour/amp.cc

index c97d6244405eaecdd2a410e947d6b46cc0d48219..132be2e1c6db4c9cf8efa2066730b77dd885a34d 100644 (file)
@@ -372,19 +372,9 @@ Amp::inc_gain (gain_t factor, void *src)
 }
 
 void
-Amp::set_gain (gain_t val, void *src)
+Amp::set_gain (gain_t val, void *)
 {
-       val = min (val, max_gain_coefficient);
-
-       if (src != _gain_control.get()) {
-               _gain_control->set_value (val);
-               // bit twisty, this will come back and call us again
-               // (this keeps control in sync with reality)
-               return;
-       }
-
-       _gain_control->set_double (val);
-       _session.set_dirty();
+       _gain_control->set_value (val);
 }
 
 XMLNode&
@@ -414,13 +404,8 @@ Amp::set_state (const XMLNode& node, int version)
 void
 Amp::GainControl::set_value (double val)
 {
-       if (val > max_gain_coefficient) {
-               val = max_gain_coefficient;
-       }
-
-       _amp->set_gain (val, this);
-
-       AutomationControl::set_value(val);
+       AutomationControl::set_value (min (val, (double) max_gain_coefficient));
+       _amp->session().set_dirty ();
 }
 
 double