Support string->value conversions for Diopser's most important parameter
This commit is contained in:
parent
32ad1212f1
commit
883b43b6a7
1 changed files with 10 additions and 0 deletions
|
@ -202,6 +202,16 @@ impl DiopserParams {
|
||||||
.with_value_to_string(Arc::new(|value| {
|
.with_value_to_string(Arc::new(|value| {
|
||||||
String::from(if value { "please don't" } else { "stop it" })
|
String::from(if value { "please don't" } else { "stop it" })
|
||||||
}))
|
}))
|
||||||
|
.with_string_to_value(Arc::new(|string| {
|
||||||
|
let string = string.trim();
|
||||||
|
if string.eq_ignore_ascii_case("please don't") {
|
||||||
|
Some(true)
|
||||||
|
} else if string.eq_ignore_ascii_case("stop it") {
|
||||||
|
Some(false)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}))
|
||||||
.hide_in_generic_ui(),
|
.hide_in_generic_ui(),
|
||||||
|
|
||||||
automation_precision: FloatParam::new(
|
automation_precision: FloatParam::new(
|
||||||
|
|
Loading…
Add table
Reference in a new issue