Skip to content

Commit

Permalink
fix: update faustpp template for better param scale pointt handling
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
  • Loading branch information
SpotlightKid committed Nov 19, 2024
1 parent 1367c4f commit b395aa7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion faust/arch/generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,10 @@ unsigned {{Identifier}}::parameter_scale_point_count(unsigned index) noexcept

const {{Identifier}}::ParameterScalePoint *{{Identifier}}::parameter_scale_point(unsigned index, unsigned point) noexcept
{
{% set ns = namespace(has_points=false) -%}
switch (index) {
{% for w in active + passive %}{% if w.style in ["menu", "radio"] %}
{% for w in active + passive %}{% if w.entries %}
{% set ns.has_points = true -%}
case {{loop.index0}}:
switch (point) {
{% for label, value in w.entries %}
Expand All @@ -307,6 +309,7 @@ const {{Identifier}}::ParameterScalePoint *{{Identifier}}::parameter_scale_point
default:
return 0;
}
{%- if not ns.has_points %}(void) point;{% endif %}
}

bool {{Identifier}}::parameter_is_trigger(unsigned index) noexcept
Expand Down

0 comments on commit b395aa7

Please sign in to comment.