Skip to main content

HostCallback_GetBeatAndTempo

Type Alias HostCallback_GetBeatAndTempo 

Source
pub type HostCallback_GetBeatAndTempo = Option<unsafe extern "C-unwind" fn(*mut c_void, *mut f64, *mut f64) -> i32>;
Expand description

Retrieve information about the current beat and/or tempo

If the host app has set this callback, then the audio unit can use this to get the current beat and tempo as they relate to the first sample in the render buffer. The audio unit can call this callback only from within the audio unit render call (otherwise the host is unable to provide information accurately to the audio unit as the information obtained is relate to the current AudioUnitRender call). If the host cannot provide the requested information, it will return kAudioUnitErr_CannotDoInCurrentContext.

The AudioUnit can provide NULL for any of the requested parameters (except for inHostUserData) if it is not interested in that particular piece of information

Parameter inHostUserData: Must be provided by the audio unit when it makes this call. It is the client data provided by the host when it set the HostCallbacks property

Parameter outCurrentBeat: The current beat, where 0 is the first beat. Tempo is defined as the number of whole-number (integer) beat values (as indicated by the outCurrentBeat field) per minute.

Parameter outCurrentTempo: The current tempo

See also Apple’s documentation

Aliased Type§

pub enum HostCallback_GetBeatAndTempo {
    None,
    Some(unsafe extern "C-unwind" fn(*mut c_void, *mut f64, *mut f64) -> i32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C-unwind" fn(*mut c_void, *mut f64, *mut f64) -> i32)

Some value of type T.