Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag for enum parameters #358

Merged
merged 3 commits into from
Nov 3, 2023
Merged

Conversation

messmerd
Copy link
Contributor

@messmerd messmerd commented Nov 2, 2023

See the proposal here: #357

This PR adds a CLAP_PARAM_IS_ENUM flag to clap_param_info_flags to denote an enum parameter.

This flag tells the host when a parameter represents a set of named options mapped to integers, which can help the host decide how to present the parameter to users in its UI.

abique and others added 2 commits October 23, 2023 14:48
Adds a CLAP_PARAM_IS_ENUM flag to clap_param_info_flags to denote an enum parameter. This flag tells the host when a parameter represents a set of named options mapped to integers, which can help the host decide how to present the parameter to users in its UI.
@CLAassistant
Copy link

CLAassistant commented Nov 2, 2023

CLA assistant check
All committers have signed the CLA.

@defiantnerd defiantnerd requested a review from abique November 2, 2023 07:15
@defiantnerd defiantnerd added specification improvement Request an improvement labels Nov 2, 2023
@defiantnerd
Copy link
Contributor

I think this is really useful PR.

@abique
Copy link
Contributor

abique commented Nov 2, 2023

Maybe it needs a comment to say that the enum isn't allowed to have "holes" between min and max?

@defiantnerd
Copy link
Contributor

Maybe it needs a comment to say that the enum isn't allowed to have "holes" between min and max?

Maybe, although it should be totally clear. You can't have holes in a normal parameter, too.

@messmerd
Copy link
Contributor Author

messmerd commented Nov 2, 2023

Maybe I could add this wording?

These named options should be available via value_to_text() for each integer value within the parameter's [min, max] range.

Copy link
Contributor

@abique abique left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the param have IS_ENUM then it must have IS_STEPPED.

I prefer to say it that way rather than implies.

@abique
Copy link
Contributor

abique commented Nov 2, 2023

Maybe I'd put the comment like this.

// Indicates that this parameter represents an enumerated value.
// If you set this flag, then you must set CLAP_PARAM_IS_STEPPED too.
// All values from min to max must have a non blank value_to_text().

@abique
Copy link
Contributor

abique commented Nov 3, 2023

Thank you 👍

@abique abique merged commit 858a09f into free-audio:next Nov 3, 2023
3 checks passed
@messmerd messmerd deleted the enum-parameters branch November 3, 2023 02:46
@baconpaul
Copy link
Collaborator

Oh this is great and I'll use it all the time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Request an improvement specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants