Publishes the host's kAudioUnitProperty_MIDIOutputCallback pair from the main thread to the render thread. More...
#include <au_v2_common.hpp>
Classes | |
| struct | Pair |
Public Member Functions | |
| OSStatus | publish (const void *in_data, UInt32 in_data_size) noexcept |
| Publish the pair carried by a kAudioUnitProperty_MIDIOutputCallback SetProperty payload. | |
| OSStatus | reflect (void *out_data) const noexcept |
| Reflect the currently published pair into a AUMIDIOutputCallbackStruct for GetProperty. | |
| const Pair * | load () const noexcept |
| Acquire-load the published pair, or nullptr when the host has installed none. | |
Publishes the host's kAudioUnitProperty_MIDIOutputCallback pair from the main thread to the render thread.
The (callback, userData) pair is written by SetProperty on the main thread and read by the render thread every block. A plain two-pointer struct is a data race that can pair a fresh callback with a stale userData, so the pair is double-buffered: the writer fills the inactive slot then release-stores a pointer to it and flips the write cursor; the reader does a single acquire-load and therefore never observes a torn pair. "AU serializes property writes against render" is NOT relied on.
|
inlinenoexcept |
Acquire-load the published pair, or nullptr when the host has installed none.
Render-thread entry point.
|
noexcept |
Publish the pair carried by a kAudioUnitProperty_MIDIOutputCallback SetProperty payload.
Returns kAudioUnitErr_InvalidPropertyValue for a null or undersized payload.
|
noexcept |
Reflect the currently published pair into a AUMIDIOutputCallbackStruct for GetProperty.