remove getter for Amp::_apply_automation_gain; reset member to false after use, and...
[ardour.git] / libs / ardour / ardour / gain_control.h
index 8dea7a7750d9514f851f18a96210fa17da5d0c9d..a2644582cef69d20a39e01bb21059432bcfd9344 100644 (file)
 #define __ardour_gain_control_h__
 
 #include <string>
-#include <set>
 
 #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<VCA>);
-       void remove_master (boost::shared_ptr<VCA>);
-       void clear_masters ();
-       bool slaved_to (boost::shared_ptr<VCA>) const;
-       std::vector<uint32_t> masters () const;
-
-       PBD::Signal0<void> VCAStatusChange;
-
-       int set_state (XMLNode const&, int);
-       XMLNode& get_state();
-
-  private:
-       void _set_value (double val, PBD::Controllable::GroupControlDisposition group_override);
-
-       mutable Glib::Threads::Mutex master_lock;
-
-       typedef std::set<boost::shared_ptr<GainControl> > Masters;
-       Masters _masters;
-       PBD::ScopedConnectionList masters_connections;
-       std::set<uint32_t> _masters_numbers;
-       std::string _masters_state_string ();
-
-       gain_t get_master_gain_locked () const;
-       void master_going_away (boost::weak_ptr<VCA>);
+protected:
+       void post_add_master (boost::shared_ptr<AutomationControl>);
+       bool get_masters_curve_locked (samplepos_t, samplepos_t, float*, samplecnt_t) const;
 };
 
 } /* namespace */