Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::format::au::PulpAUEffect Class Reference

#include <au_v2_adapter.hpp>

Public Member Functions

 PulpAUEffect (AudioComponentInstance ci)
 PulpAUEffect (AudioComponentInstance ci, ProcessorFactory factory)
OSStatus GetParameterList (AudioUnitScope inScope, AudioUnitParameterID *outParameterList, UInt32 &outNumParameters) override
OSStatus GetParameterInfo (AudioUnitScope inScope, AudioUnitParameterID inParameterID, AudioUnitParameterInfo &outParameterInfo) override
OSStatus GetParameterValueStrings (AudioUnitScope inScope, AudioUnitParameterID inParameterID, CFArrayRef *outStrings) override
OSStatus GetParameter (AudioUnitParameterID inID, AudioUnitScope inScope, AudioUnitElement inElement, Float32 &outValue) override
OSStatus SetParameter (AudioUnitParameterID inID, AudioUnitScope inScope, AudioUnitElement inElement, Float32 inValue, UInt32 inBufferOffsetInFrames) override
OSStatus ScheduleParameter (const AudioUnitParameterEvent *events, UInt32 num_events) override
OSStatus GetPropertyInfo (AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, UInt32 &outDataSize, bool &outWritable) override
OSStatus GetProperty (AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, void *outData) override
OSStatus SetProperty (AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, const void *inData, UInt32 inDataSize) override
UInt32 SupportedNumChannels (const AUChannelInfo **outInfo) override
 Surface the plugin's supported (input, output) channel-count pairs so the host (and auval) can negotiate a layout.
OSStatus Initialize () override
void Cleanup () override
void CreateExtendedElements () override
 Adds the side-chain input element (element 1, named "Side Chain") when the descriptor declares a side-chain bus.
OSStatus Render (AudioUnitRenderActionFlags &ioActionFlags, const AudioTimeStamp &inTimeStamp, UInt32 nFrames) override
 Pulls the side-chain input element (when the host connected it or installed a render callback on it), then runs the stock effect render, which pulls the main input and calls ProcessBufferLists.
bool ValidFormat (AudioUnitScope inScope, AudioUnitElement inElement, const AudioStreamBasicDescription &inNewFormat) override
 Side-chain element formats must also fit the adapter's per-bus channel ceiling; every other element keeps the stock AU format rules.
OSStatus ChangeStreamFormat (AudioUnitScope inScope, AudioUnitElement inElement, const AudioStreamBasicDescription &inPrevFormat, const AudioStreamBasicDescription &inNewFormat) override
 Keeps the side-chain element's sample rate in step with the main bus so a host that only configures element 0 still initializes cleanly.
OSStatus ProcessBufferLists (AudioUnitRenderActionFlags &ioActionFlags, const AudioBufferList &inBuffer, AudioBufferList &outBuffer, UInt32 inFramesToProcess) override
OSStatus GetPresets (CFArrayRef *outData) const override
 kAudioUnitProperty_FactoryPresets — the presets bundled with the plug-in, discovered from its Resources/Presets folder.
OSStatus NewFactoryPresetSet (const AUPreset &inNewFactoryPreset) override
 kAudioUnitProperty_PresentPreset carrying a non-negative preset number.
FactoryPresetTable & factory_preset_table () noexcept
 The factory-preset table this instance serves.
OSStatus SaveState (CFPropertyListRef *outData) override
OSStatus RestoreState (CFPropertyListRef plist) override
bool SupportsTail () override
Float64 GetTailTime () override
Float64 GetLatency () override
ParamEventsOptOutMonitor & param_events_monitor ()
 The opted-out-reader record for this unit's processor.

Protected Member Functions

void queue_scheduled_events (const ParameterEventList &events, UInt32 frames_to_process)
void write_scheduled_end_values (ParameterEventList &events, UInt32 frames_to_process)
OSStatus ProcessForScheduledParams (ParameterEventList &events, UInt32 frames_to_process, void *user_data) override
OSStatus ProcessScheduledSlice (void *user_data, UInt32 start_frame_in_buffer, UInt32 slice_frames, UInt32 total_buffer_frames) override
void publish_parameter_display_changes ()
 Drain host-facing name changes on the caller's control/main thread.
OSStatus HandleMIDIEvent (UInt8 inStatus, UInt8 inChannel, UInt8 inData1, UInt8 inData2, UInt32 inStartFrame) override
 Called by the AU host for every short MIDI message (status has already been split into inStatus / inChannel).
OSStatus HandleSysEx (const UInt8 *inData, UInt32 inLength) override
 System-exclusive payload (F0 … F7).

Constructor & Destructor Documentation

◆ PulpAUEffect() [1/2]

pulp::format::au::PulpAUEffect::PulpAUEffect ( AudioComponentInstance ci)
explicit

◆ PulpAUEffect() [2/2]

pulp::format::au::PulpAUEffect::PulpAUEffect ( AudioComponentInstance ci,
ProcessorFactory factory )

Member Function Documentation

◆ ChangeStreamFormat()

OSStatus pulp::format::au::PulpAUEffect::ChangeStreamFormat ( AudioUnitScope inScope,
AudioUnitElement inElement,
const AudioStreamBasicDescription & inPrevFormat,
const AudioStreamBasicDescription & inNewFormat )
override

Keeps the side-chain element's sample rate in step with the main bus so a host that only configures element 0 still initializes cleanly.

◆ Cleanup()

void pulp::format::au::PulpAUEffect::Cleanup ( )
override

◆ CreateExtendedElements()

void pulp::format::au::PulpAUEffect::CreateExtendedElements ( )
override

Adds the side-chain input element (element 1, named "Side Chain") when the descriptor declares a side-chain bus.

AUEffectBase constructs a single input element; hosts discover a side-chain input purely from the input scope's element count, so this is what makes Logic offer its Side Chain pop-up.

◆ factory_preset_table()

FactoryPresetTable & pulp::format::au::PulpAUEffect::factory_preset_table ( )
inlinenoexcept

The factory-preset table this instance serves.

Exposed so a plug-in whose presets live outside the default bundle folder can re-point discovery before the host scans.

◆ GetLatency()

Float64 pulp::format::au::PulpAUEffect::GetLatency ( )
override

◆ GetParameter()

OSStatus pulp::format::au::PulpAUEffect::GetParameter ( AudioUnitParameterID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
Float32 & outValue )
override

◆ GetParameterInfo()

OSStatus pulp::format::au::PulpAUEffect::GetParameterInfo ( AudioUnitScope inScope,
AudioUnitParameterID inParameterID,
AudioUnitParameterInfo & outParameterInfo )
override

◆ GetParameterList()

OSStatus pulp::format::au::PulpAUEffect::GetParameterList ( AudioUnitScope inScope,
AudioUnitParameterID * outParameterList,
UInt32 & outNumParameters )
override

◆ GetParameterValueStrings()

OSStatus pulp::format::au::PulpAUEffect::GetParameterValueStrings ( AudioUnitScope inScope,
AudioUnitParameterID inParameterID,
CFArrayRef * outStrings )
override

◆ GetPresets()

OSStatus pulp::format::au::PulpAUEffect::GetPresets ( CFArrayRef * outData) const
override

kAudioUnitProperty_FactoryPresets — the presets bundled with the plug-in, discovered from its Resources/Presets folder.

Reports kAudioUnitErr_InvalidProperty when the plug-in ships none, so a host hides the menu rather than showing an empty one.

◆ GetProperty()

OSStatus pulp::format::au::PulpAUEffect::GetProperty ( AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
void * outData )
override

◆ GetPropertyInfo()

OSStatus pulp::format::au::PulpAUEffect::GetPropertyInfo ( AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
UInt32 & outDataSize,
bool & outWritable )
override

◆ GetTailTime()

Float64 pulp::format::au::PulpAUEffect::GetTailTime ( )
override

◆ HandleMIDIEvent()

OSStatus pulp::format::au::PulpAUEffect::HandleMIDIEvent ( UInt8 inStatus,
UInt8 inChannel,
UInt8 inData1,
UInt8 inData2,
UInt32 inStartFrame )
overrideprotected

Called by the AU host for every short MIDI message (status has already been split into inStatus / inChannel).

Converts the bytes to a midi::MidiEvent and pushes it onto the lock-free render queue. Drained in ProcessBufferLists.

Note: DAW hosts only route MIDI to an AU v2 effect when the bundle's component type is aumf (kAudioUnitType_MusicEffect). Plug-ins packaged as aufx still have this override wired — the host just never calls it — so leaving the path here for aufx plug-ins is harmless.

◆ HandleSysEx()

OSStatus pulp::format::au::PulpAUEffect::HandleSysEx ( const UInt8 * inData,
UInt32 inLength )
overrideprotected

System-exclusive payload (F0 … F7).

AUMIDIBase::HandleSysEx does not carry a per-event sample offset at this SDK layer — we enqueue the sysex with sample_offset == 0 so it is delivered at the block boundary.

◆ Initialize()

OSStatus pulp::format::au::PulpAUEffect::Initialize ( )
override

◆ NewFactoryPresetSet()

OSStatus pulp::format::au::PulpAUEffect::NewFactoryPresetSet ( const AUPreset & inNewFactoryPreset)
override

kAudioUnitProperty_PresentPreset carrying a non-negative preset number.

Loads that factory preset into the StateStore, so a host's selection changes what the plug-in sounds like instead of only relabelling the menu.

◆ param_events_monitor()

ParamEventsOptOutMonitor & pulp::format::au::PulpAUEffect::param_events_monitor ( )
inline

The opted-out-reader record for this unit's processor.

◆ ProcessBufferLists()

OSStatus pulp::format::au::PulpAUEffect::ProcessBufferLists ( AudioUnitRenderActionFlags & ioActionFlags,
const AudioBufferList & inBuffer,
AudioBufferList & outBuffer,
UInt32 inFramesToProcess )
override

◆ ProcessForScheduledParams()

OSStatus pulp::format::au::PulpAUEffect::ProcessForScheduledParams ( ParameterEventList & events,
UInt32 frames_to_process,
void * user_data )
overrideprotected

◆ ProcessScheduledSlice()

OSStatus pulp::format::au::PulpAUEffect::ProcessScheduledSlice ( void * user_data,
UInt32 start_frame_in_buffer,
UInt32 slice_frames,
UInt32 total_buffer_frames )
overrideprotected

◆ publish_parameter_display_changes()

void pulp::format::au::PulpAUEffect::publish_parameter_display_changes ( )
protected

Drain host-facing name changes on the caller's control/main thread.

◆ queue_scheduled_events()

void pulp::format::au::PulpAUEffect::queue_scheduled_events ( const ParameterEventList & events,
UInt32 frames_to_process )
protected

◆ Render()

OSStatus pulp::format::au::PulpAUEffect::Render ( AudioUnitRenderActionFlags & ioActionFlags,
const AudioTimeStamp & inTimeStamp,
UInt32 nFrames )
override

Pulls the side-chain input element (when the host connected it or installed a render callback on it), then runs the stock effect render, which pulls the main input and calls ProcessBufferLists.

The pulled side-chain buffer list is only referenced for the duration of the call.

◆ RestoreState()

OSStatus pulp::format::au::PulpAUEffect::RestoreState ( CFPropertyListRef plist)
override

◆ SaveState()

OSStatus pulp::format::au::PulpAUEffect::SaveState ( CFPropertyListRef * outData)
override

◆ ScheduleParameter()

OSStatus pulp::format::au::PulpAUEffect::ScheduleParameter ( const AudioUnitParameterEvent * events,
UInt32 num_events )
override

◆ SetParameter()

OSStatus pulp::format::au::PulpAUEffect::SetParameter ( AudioUnitParameterID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
Float32 inValue,
UInt32 inBufferOffsetInFrames )
override

◆ SetProperty()

OSStatus pulp::format::au::PulpAUEffect::SetProperty ( AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
const void * inData,
UInt32 inDataSize )
override

◆ SupportedNumChannels()

UInt32 pulp::format::au::PulpAUEffect::SupportedNumChannels ( const AUChannelInfo ** outInfo)
override

Surface the plugin's supported (input, output) channel-count pairs so the host (and auval) can negotiate a layout.

Derived from the descriptor via build_channel_info. Returns the pair count; fills a per-instance static table when outInfo is non-null. 0 from the base class meant "property unsupported", which left every channel-config query unanswered.

◆ SupportsTail()

bool pulp::format::au::PulpAUEffect::SupportsTail ( )
override

◆ ValidFormat()

bool pulp::format::au::PulpAUEffect::ValidFormat ( AudioUnitScope inScope,
AudioUnitElement inElement,
const AudioStreamBasicDescription & inNewFormat )
override

Side-chain element formats must also fit the adapter's per-bus channel ceiling; every other element keeps the stock AU format rules.

◆ write_scheduled_end_values()

void pulp::format::au::PulpAUEffect::write_scheduled_end_values ( ParameterEventList & events,
UInt32 frames_to_process )
protected

The documentation for this class was generated from the following file: