#[repr(u32)]pub enum ParameterUnit {
Show 27 variants
Generic = 0,
Indexed = 1,
Boolean = 2,
Percent = 3,
Seconds = 4,
SampleFrames = 5,
Phase = 6,
Rate = 7,
Hertz = 8,
Cents = 9,
RelativeSemiTones = 10,
MidiNoteNumber = 11,
MidiController = 12,
Decibels = 13,
LinearGain = 14,
Degrees = 15,
EqualPowerCrossfade = 16,
MixerFaderCurve1 = 17,
Pan = 18,
Meters = 19,
AbsoluteCents = 20,
Octaves = 21,
Bpm = 22,
Beats = 23,
Milliseconds = 24,
Ratio = 25,
CustomUnit = 26,
}Expand description
AudioUnitParameterUnit values for parameter type hints.
These values tell AU hosts what visual control to render for a parameter:
Boolean→ CheckboxIndexed→ Dropdown menuDecibels,Hertz, etc. → Slider with appropriate unit display
The values match Apple’s AudioUnitParameterUnit enum from
AudioToolbox/AudioUnitProperties.h for direct FFI compatibility.
§Example
// Most constructors set this automatically:
let gain = FloatParameter::db("Gain", 0.0, -60.0..=12.0); // → Decibels
let enabled = BoolParameter::new("Enabled", true); // → Boolean
// Override if needed:
let custom = FloatParameter::new("Custom", 0.5, 0.0..=1.0)
.with_unit(ParameterUnit::Percent);Variants§
Generic = 0
Generic parameter (default slider)
Indexed = 1
Indexed parameter (dropdown menu for enums)
Boolean = 2
Boolean parameter (checkbox)
Percent = 3
Percentage (0-100%)
Seconds = 4
Time in seconds
SampleFrames = 5
Sample frames
Phase = 6
Phase (0-360 degrees or 0-1)
Rate = 7
Rate multiplier
Hertz = 8
Frequency in Hertz
Cents = 9
Pitch in cents
RelativeSemiTones = 10
Relative pitch in semitones
MidiNoteNumber = 11
MIDI note number (0-127)
MidiController = 12
MIDI controller value (0-127)
Decibels = 13
Level in decibels
LinearGain = 14
Linear gain (0.0-1.0+)
Degrees = 15
Angle in degrees
EqualPowerCrossfade = 16
Equal power crossfade
MixerFaderCurve1 = 17
Mixer fader curve 1
Pan = 18
Stereo pan (-1 to +1)
Meters = 19
Distance in meters
AbsoluteCents = 20
Absolute pitch in cents
Octaves = 21
Pitch in octaves
Bpm = 22
Tempo in beats per minute
Beats = 23
Musical beats
Milliseconds = 24
Time in milliseconds
Ratio = 25
Ratio (e.g., compression ratio)
CustomUnit = 26
Custom unit (use units string for display)
Trait Implementations§
Source§impl Clone for ParameterUnit
impl Clone for ParameterUnit
Source§fn clone(&self) -> ParameterUnit
fn clone(&self) -> ParameterUnit
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more