#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 ¶m,
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 */