change VCA number to signed.
[ardour.git] / libs / ardour / ardour / gain_control.h
index 8dea7a7750d9514f851f18a96210fa17da5d0c9d..f72320f1dd59ca47417dfcde3d53d6d816131862 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);
-
        double internal_to_interface (double) const;
        double interface_to_internal (double) const;
        double internal_to_user (double) const;
@@ -53,31 +48,13 @@ class LIBARDOUR_API GainControl : public AutomationControl {
        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);
+       void inc_gain (gain_t);
 
-       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>);
+  private:
+       void recompute_masters_ratios (double val);
 };
 
 } /* namespace */