Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
au_v2_common.hpp File Reference
#include <pulp/runtime/alive_token.hpp>
#include <AudioUnitSDK/AUBase.h>
#include <cstddef>
#include <AudioToolbox/AudioUnitProperties.h>
#include <AudioUnit/AudioUnit.h>
#include <CoreFoundation/CoreFoundation.h>
#include <CoreMIDI/MIDIServices.h>
#include <mach/mach_time.h>
#include <pulp/format/au_factory_presets.hpp>
#include <pulp/format/detail/host_sample_position.hpp>
#include <pulp/format/processor.hpp>
#include <pulp/format/state_restore_gate.hpp>
#include <pulp/format/detail/midi_out_offset.hpp>
#include <pulp/format/detail/playhead_diff.hpp>
#include <pulp/midi/buffer.hpp>
#include <pulp/midi/message.hpp>
#include <pulp/state/listener_token.hpp>
#include <pulp/state/store.hpp>
#include <array>
#include <atomic>
#include <cstdint>
#include <functional>
#include <limits>
#include <memory>

Go to the source code of this file.

Classes

struct  pulp::format::au::PulpEditorContext
class  pulp::format::au::OfflineRenderProperty
 Host offline-render intent for an AU v2 instance. More...
struct  pulp::format::au::MidiOutputPacketBuilder
class  pulp::format::au::RenderContextObserverProperty
 kAudioUnitProperty_RenderContextObserver, the v2 form of AUv3's renderContextObserver. More...
class  pulp::format::au::ScopedHostParamWrite
 RAII marker for the host-write window. Scoped to the calling thread. More...
class  pulp::format::au::ParameterDisplayNamePublisher
 Coalesces StateStore presentation-name changes and republishes only the affected stable parameter IDs from the host's main thread. More...
class  pulp::format::au::MidiOutputCallbackPublisher
 Publishes the host's kAudioUnitProperty_MIDIOutputCallback pair from the main thread to the render thread. More...
struct  pulp::format::au::MidiOutputCallbackPublisher::Pair

Namespaces

namespace  pulp
namespace  pulp::format
 What the product grants a device: the quota table indexed by capability tier and live thermal state.
namespace  pulp::format::au
 Apple-only: the whole header is gated on APPLE so it stays an empty no-op on the Linux header-hygiene check.

Typedefs

using pulp::format::au::CocoaViewInfoFiller = bool (*)(void*)
 Cross-TU Cocoa-view hook.

Functions

bool pulp::format::au::fill_cocoa_view_info (void *outData)
 Fills an AudioUnitCocoaViewInfo with the Pulp Cocoa view factory's bundle URL + class name.
ContractEditorSession * pulp::format::au::contract_view_session (void *ns_view)
 The session behind an AU v2 contract view (the NSView the contract view factory returned), or null for any other view or once it is invalidated, so an in-process host (automation, tests) can reach the editor and its EditorAutomation.
midi::MidiEvent pulp::format::au::decode_midi_event (uint8_t inStatus, uint8_t inChannel, uint8_t inData1, uint8_t inData2) noexcept
 Decode a short MIDI status byte and two data bytes into a midi::MidiEvent.
ProcessContext pulp::format::au::make_render_process_context (double sample_rate, int num_samples, bool offline=false) noexcept
 Build the AU v2 render-path ProcessContext fields that are independent of host callbacks.
void pulp::format::au::apply_host_callbacks_to_process_context (ProcessContext &ctx, const ausdk::AUBase &unit, detail::PlayheadSnapshot &previous) noexcept
 Populate AU v2 render-context transport metadata from host callbacks and derive per-block playhead change flags.
Float64 pulp::format::au::tail_samples_to_seconds (int tail_samples, double sample_rate) noexcept
OSStatus pulp::format::au::fill_parameter_list (const state::StateStore &store, AudioUnitScope scope, AudioUnitParameterID *out_list, UInt32 &out_count)
 GetParameterList: report every global-scope parameter ID.
OSStatus pulp::format::au::fill_parameter_info (const state::StateStore &store, AudioUnitScope scope, AudioUnitParameterID param_id, AudioUnitParameterInfo &out_info, bool advertise_value_strings)
 GetParameterInfo: name, range, and unit.
OSStatus pulp::format::au::fill_parameter_clump_property_info (const state::StateStore &store, AudioUnitScope scope, UInt32 &out_size, bool &out_writable)
OSStatus pulp::format::au::fill_supports_mpe_property_info (bool supports_mpe, AudioUnitScope scope, UInt32 &out_size, bool &out_writable)
 kAudioUnitProperty_SupportsMPE (the v2 bridge of AUv3's supportsMPE).
OSStatus pulp::format::au::fill_supports_mpe (bool supports_mpe, AudioUnitScope scope, void *out_data)
OSStatus pulp::format::au::fill_parameter_clump_name (const state::StateStore &store, AudioUnitScope scope, void *out_data)
OSStatus pulp::format::au::fill_parameter_value_strings (const state::StateStore &store, AudioUnitScope scope, AudioUnitParameterID param_id, CFArrayRef *out_strings)
 GetParameterValueStrings: the enumerated display strings for a DISCRETE parameter.
OSStatus pulp::format::au::parameter_string_from_value (const state::StateStore &store, void *out_data)
 kAudioUnitProperty_ParameterStringFromValue.
OSStatus pulp::format::au::parameter_value_from_string (const state::StateStore &store, void *out_data)
 kAudioUnitProperty_ParameterValueFromString — text entry, string → value.
bool pulp::format::au::host_is_writing_param () noexcept
 True while this thread is inside a host-originated SetParameter.
void pulp::format::au::wire_host_parameter_bridge (state::StateStore &store, AudioUnit unit, state::ListenerToken &out_listener)
 Wire the editor → host parameter path: gesture begin/end brackets (so a drag records one clean automation pass) and a value-change notification so the host re-reads through GetParameter.
OSStatus pulp::format::au::save_pulp_state (state::StateStore &store, Processor &processor, CFPropertyListRef *out_data)
 Attach Pulp's serialized state to the AU class-info dictionary the base class produced.
OSStatus pulp::format::au::restore_pulp_state (state::StateStore &store, Processor &processor, StateRestoreGate &gate, CFPropertyListRef plist)
 Read the pulp-state blob back out of an AU class-info dictionary.
CFArrayRef pulp::format::au::make_midi_output_names (const char *stream_name)
 Build the one-element CFArrayRef a host reads from kAudioUnitProperty_MIDIOutputCallbackInfo — the names of the plugin's MIDI output streams.

Variables

constexpr std::size_t pulp::format::au::kMaxChannelInfoPairs = 16
 Upper bound on AUChannelInfo pairs an adapter advertises through SupportedNumChannels.
static constexpr AudioUnitPropertyID pulp::format::au::kPulpEditorContextProperty = 0x50754564
 Custom AU property ID the Cocoa view factory queries to obtain the host-side Processor + StateStore pointers.
CocoaViewInfoFiller pulp::format::au::g_cocoa_view_info_filler
constexpr std::size_t pulp::format::au::kMaxMidiEventsPerBlock = 2048
 RT-safe builder for the MIDIPacketList an AU v2 plugin hands the host via kAudioUnitProperty_MIDIOutputCallback.