Closed IcedQuinn closed 1 year ago
Take a look at the clap_plugin_params::value_to_text()
and clap_plugin_params::text_to_value()
functions:
Any parameter can (and probably should!) have custom conversion functions that map between the untyped floating point value used to communicate parameter values between the plugin and the host and the actual meaning of those values.
And there’s an example of using it to make a stepped parameter show discrete non integral names in the clap saw demo (which is a super direct interpretation of the api)
@baconpaul @robbert-vdh so the recommended method is to check if a parameter has the integer bit set and then query for the name of every integer in range?
yes that'll work.
Yes
See REAPER's generic UI for an example. They show stepped parameters as dropdown menus.
In LV2 there is an extension where if a parameter is marked as stepped you may also provide the name of each integer value in the manifest. This allows a plugin to for example make a filter controlled by a parameter, which is stepped, and export that the values mean "Low Pass Filter" or "High Pass Filter." The plugin UI can then read this out of the manifest and present them to the user.
I didn't see a feature like this when I read the CLAP spec; does this already exist or will it need a new draft extension?