function cleanup()
if params:get("output") == 5 then
crow.ii.jf.mode(0)
end
end
Perhaps this is nitpicky and an uncommon use case, but what if I switch to output 5, and then switch back to output 4 before exiting?
Seems maybe something like this should also be added:
params:set_action('output', function(val)
if prev_output == 5 and val ~= prev_output then
crow.ii.jf.mode(0)
end
prev_output = val
end)
This also makes me wonder if the 2nd param in the set_action callback should be the previous value, so you don’t have to store a reference to it elsewhere (this would’ve helped me in some other use cases as well). But maybe that’s a conversation for github or another thread…