VST3: fix discrete parameters
Some plugins have a min/max range of 1, for stepwise enumerated values of a control. e.g. waves maps note-names this way. https://discourse.ardour.org/t/106429/
This commit is contained in:
parent
877f56e575
commit
e2efb698e0
@ -1631,7 +1631,7 @@ VST3PI::get_parameter_descriptor (uint32_t port, ParameterDescriptor& desc) cons
|
|||||||
desc.normal = _controller->normalizedParamToPlain (id, p.normal);
|
desc.normal = _controller->normalizedParamToPlain (id, p.normal);
|
||||||
desc.toggled = 1 == p.steps;
|
desc.toggled = 1 == p.steps;
|
||||||
desc.logarithmic = false;
|
desc.logarithmic = false;
|
||||||
desc.integer_step = p.steps > 1 ? p.steps : 0;
|
desc.integer_step = p.steps > 1 && (desc.upper - desc.lower) == p.steps;
|
||||||
desc.sr_dependent = false;
|
desc.sr_dependent = false;
|
||||||
desc.enumeration = p.is_enum;
|
desc.enumeration = p.is_enum;
|
||||||
desc.label = p.label;
|
desc.label = p.label;
|
||||||
@ -1640,6 +1640,9 @@ VST3PI::get_parameter_descriptor (uint32_t port, ParameterDescriptor& desc) cons
|
|||||||
} else if (p.unit == "Hz") {
|
} else if (p.unit == "Hz") {
|
||||||
desc.unit = ARDOUR::ParameterDescriptor::HZ;
|
desc.unit = ARDOUR::ParameterDescriptor::HZ;
|
||||||
}
|
}
|
||||||
|
if (p.steps > 1) {
|
||||||
|
desc.rangesteps = 1 + p.steps;
|
||||||
|
}
|
||||||
|
|
||||||
FUnknownPtr<IEditControllerExtra> extra_ctrl (_controller);
|
FUnknownPtr<IEditControllerExtra> extra_ctrl (_controller);
|
||||||
if (extra_ctrl && port != designated_bypass_port ()) {
|
if (extra_ctrl && port != designated_bypass_port ()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user