AUParameterFormatValue

Function AUParameterFormatValue 

Source
pub unsafe extern "C-unwind" fn AUParameterFormatValue(
    in_parameter_value: f64,
    in_parameter: NonNull<AudioUnitParameter>,
    in_text_buffer: NonNull<c_char>,
    in_digits: u32,
) -> NonNull<c_char>
Available on crate features AUComponent and AudioComponent and AudioUnitUtilities only.
Expand description

Format a parameter value into a string.

Parameter inParameterValue: The parameter value to be formatted.

Parameter inParameter: The Audio Unit, scope, element, and parameter whose value this is.

Parameter inTextBuffer: The character array to receive the formatted text. Should be at least 32 characters.

Parameter inDigits: The resolution of the string (see example above).

Returns: inTextBuffer

Formats a floating point value into a string. Computes a power of 10 to which the value will be rounded and displayed as follows: if the the parameter is logarithmic (Hertz), the number of significant digits is inDigits - pow10(inParameterValue) + 1. Otherwise, it is inDigits - pow10(maxValue - minValue) + 1.

Example for inDigits=3:

pow10rangedigits after decimal place display
-2.0100-.09994
-1.100-.9993
01.00-9.992
110.0-99.91
2100-9990
31000-9990-1
410000-99900-2

ยงSafety

  • in_parameter must be a valid pointer.
  • in_text_buffer must be a valid pointer.