Module param_format

Module param_format 

Source
Expand description

Parameter value formatting and parsing.

This module provides the Formatter enum for converting between plain parameter values and display strings. Each formatter variant handles a specific unit type (dB, Hz, ms, etc.) with appropriate formatting and parsing logic.

§Example

use beamer_core::param_format::Formatter;

let db_formatter = Formatter::Decibel { precision: 1 };
assert_eq!(db_formatter.format(1.0), "0.0 dB");  // 1.0 linear = 0 dB
assert_eq!(db_formatter.format(0.5), "-6.0 dB"); // 0.5 linear ≈ -6 dB

let hz_formatter = Formatter::Frequency;
assert_eq!(hz_formatter.format(440.0), "440 Hz");
assert_eq!(hz_formatter.format(1500.0), "1.50 kHz");

Enums§

Formatter
Parameter value formatter.