remove getter for Amp::_apply_automation_gain; reset member to false after use, and...
[ardour.git] / libs / ardour / ardour / gain_control.h
index c6421a6922a673629e7b9428737056e91936d04c..a2644582cef69d20a39e01bb21059432bcfd9344 100644 (file)
 #define __ardour_gain_control_h__
 
 #include <string>
-#include <list>
 
 #include <boost/shared_ptr.hpp>
-#include <glibmm/threads.h>
 
 #include "pbd/controllable.h"
 
 #include "evoral/Parameter.hpp"
 
-#include "ardour/automation_control.h"
+#include "ardour/slavable_automation_control.h"
 #include "ardour/libardour_visibility.h"
 
 namespace ARDOUR {
 
 class Session;
 
-class LIBARDOUR_API GainControl : public AutomationControl {
+class LIBARDOUR_API GainControl : public SlavableAutomationControl {
   public:
        GainControl (Session& session, const Evoral::Parameter &param,
                     boost::shared_ptr<AutomationList> al = boost::shared_ptr<AutomationList>());
 
-       void set_value (double val, PBD::Controllable::GroupControlDisposition group_override);
-       void set_value_unchecked (double);
+       void inc_gain (gain_t);
 
-       double internal_to_interface (double) const;
-       double interface_to_internal (double) const;
-       double internal_to_user (double) const;
-       double user_to_internal (double) const;
-       std::string get_user_string () const;
-
-       double lower_db;
-       double range_db;
-
-       gain_t get_master_gain () const;
-       void add_master (boost::shared_ptr<GainControl>);
-       void remove_master (boost::shared_ptr<GainControl>);
-       void clear_masters ();
-
-  private:
-       void _set_value (double val, PBD::Controllable::GroupControlDisposition group_override);
-
-       mutable Glib::Threads::Mutex master_lock;
-
-       typedef std::list<boost::shared_ptr<GainControl> > Masters;
-       Masters _masters;
-
-       gain_t get_master_gain_locked () const;
+protected:
+       void post_add_master (boost::shared_ptr<AutomationControl>);
+       bool get_masters_curve_locked (samplepos_t, samplepos_t, float*, samplecnt_t) const;
 };
 
 } /* namespace */