-
Notifications
You must be signed in to change notification settings - Fork 4
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
Question/request for Example #5
Comments
@CD10h Thanks for using the project! If you want to see what code is generated by But, if you want to implement it manually, you basically just need to implement struct MyParams {
my_float: f64,
}
impl OperatorParams for MyParams {
fn register(&mut self, parameter_manager: &mut ParameterManager) {
parameter_manager.append_float(NumericParameter {
name: "Myfloat".to_string(),
label: "My Float".to_string(),
page: "Custom".to_string(),
default_values: [0.0; 4],
min_values: [0.0; 4],
max_values: [1.0; 4],
clamp_mins: [true; 4],
clamp_maxes: [true; 4],
min_sliders: [0.0; 4],
max_sliders: [5.0; 4],
});
}
fn update(&mut self, inputs: &ParamInputs) {
self.my_float = inputs.get_float("Myfloat", 0);
}
} These should be roughly comparable to the C++ examples, and I'd look there for further documentation about how to use the parameter manager and read inputs back. Then, if you wanted to initialize your param struct through something like reading a config, etc, just do that in For enabling and disabling params, see the example here: td-rs/plugins/chop/generator/src/lib.rs Lines 62 to 63 in 4fddc52
execute impl.
Please let me know if you have any other questions! |
Could you provide a plugin example with dynamic creation/updates of parameters without using
derive(Params)
?Let's say, for example, I get possible options from a file or another lib and would like to create/remove based on its contents or, as another example, enabling/disabling certain UI options or menus based on the state of another.
note: this is a great project, thank you for providing this. btw I have a branch on my fork with ntsc-rs as a quick and dirty plugin.
The text was updated successfully, but these errors were encountered: