INNER CODE UNIT · Rust
from_port_name
Rikorose/DeepFilterNet · ladspa/src/lib.rs:268
fn from_port_name(name: &str) -> Self {
match name {
"Attenuation Limit (dB)" => Self::AttenLim,
"Post Filter Beta" => Self::PfBeta,
"Min processing threshold (dB)" => Self::MinThreshDb,
"Max ERB processing threshold (dB)" => Self::MaxErbThreshDb,
"Max DF processing threshold (dB)" => Self::MaxDfThreshDb,
"Min Processing Buffer (frames)" => Self::MinBufferFrames,
_ => panic!("name not found"),
}
}
}
impl fmt::Display for DfControl {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result {
match self {
DfControl::AttenLim => write!(f, "Attenuation Limit (dB)"),
DfControl::PfBeta => write!(f, "Post Filter Beta"),
DfControl::MinThreshDb => write!(f, "Min processing threshold (dB)"),