Constrain gain-control range (notably trim)
This commit is contained in:
parent
cce6aba35d
commit
d2fdd72bc4
@ -44,6 +44,7 @@ class LIBARDOUR_API GainControl : public SlavableAutomationControl {
|
||||
protected:
|
||||
void post_add_master (std::shared_ptr<AutomationControl>);
|
||||
bool get_masters_curve_locked (samplepos_t, samplepos_t, float*, samplecnt_t) const;
|
||||
void actually_set_value (double value, PBD::Controllable::GroupControlDisposition);
|
||||
};
|
||||
|
||||
} /* namespace */
|
||||
|
@ -107,6 +107,17 @@ GainControl::inc_gain (gain_t factor)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GainControl::actually_set_value (double value, PBD::Controllable::GroupControlDisposition gcd)
|
||||
{
|
||||
const double max_factor = _desc.from_interface (1.0);
|
||||
const double min_factor = _desc.from_interface (0.0);
|
||||
|
||||
value = std::max (min_factor, std::min (value, max_factor));
|
||||
|
||||
SlavableAutomationControl::actually_set_value (value, gcd);
|
||||
}
|
||||
|
||||
void
|
||||
GainControl::post_add_master (std::shared_ptr<AutomationControl> m)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user