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

#include <au_v2_instrument.hpp>

Public Member Functions

 PulpAUInstrument (AudioComponentInstance ci)
 PulpAUInstrument (AudioComponentInstance ci, ProcessorFactory factory)
OSStatus GetParameterList (AudioUnitScope inScope, AudioUnitParameterID *outParameterList, UInt32 &outNumParameters) override
OSStatus GetParameterInfo (AudioUnitScope inScope, AudioUnitParameterID inParameterID, AudioUnitParameterInfo &outParameterInfo) 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 GetParameterValueStrings (AudioUnitScope inScope, AudioUnitParameterID inParameterID, CFArrayRef *outStrings) 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
OSStatus Initialize () override
void Cleanup () override
bool StreamFormatWritable (AudioUnitScope scope, AudioUnitElement element) override
bool CanScheduleParameters () const noexcept override
UInt32 SupportedNumChannels (const AUChannelInfo **outInfo) override
bool ValidFormat (AudioUnitScope inScope, AudioUnitElement inElement, const AudioStreamBasicDescription &inNewFormat) override
OSStatus ChangeStreamFormat (AudioUnitScope inScope, AudioUnitElement inElement, const AudioStreamBasicDescription &inPrevFormat, const AudioStreamBasicDescription &inNewFormat) override
OSStatus HandleNoteOn (UInt8 inChannel, UInt8 inNoteNumber, UInt8 inVelocity, UInt32 inStartFrame) override
OSStatus HandleNoteOff (UInt8 inChannel, UInt8 inNoteNumber, UInt8 inVelocity, UInt32 inStartFrame) override
OSStatus HandleNonNoteEvent (UInt8 inStatus, UInt8 inChannel, UInt8 inData1, UInt8 inData2, UInt32 inStartFrame) override
 Every non-note channel-voice message (control change, program change, pitch bend, channel and polyphonic pressure).
OSStatus HandleSysEx (const UInt8 *inData, UInt32 inLength) override
 System-exclusive payload (F0 … F7).
OSStatus Render (AudioUnitRenderActionFlags &ioActionFlags, const AudioTimeStamp &inTimeStamp, UInt32 inNumberFrames) 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

Protected Member Functions

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

Constructor & Destructor Documentation

◆ PulpAUInstrument() [1/2]

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

◆ PulpAUInstrument() [2/2]

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

Member Function Documentation

◆ CanScheduleParameters()

bool pulp::format::au::PulpAUInstrument::CanScheduleParameters ( ) const
overridenoexcept

◆ ChangeStreamFormat()

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

◆ Cleanup()

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

◆ factory_preset_table()

FactoryPresetTable & pulp::format::au::PulpAUInstrument::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::PulpAUInstrument::GetLatency ( )
override

◆ GetParameter()

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

◆ GetParameterInfo()

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

◆ GetParameterList()

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

◆ GetParameterValueStrings()

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

◆ GetPresets()

OSStatus pulp::format::au::PulpAUInstrument::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::PulpAUInstrument::GetProperty ( AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
void * outData )
override

◆ GetPropertyInfo()

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

◆ GetTailTime()

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

◆ HandleNonNoteEvent()

OSStatus pulp::format::au::PulpAUInstrument::HandleNonNoteEvent ( UInt8 inStatus,
UInt8 inChannel,
UInt8 inData1,
UInt8 inData2,
UInt32 inStartFrame )
override

Every non-note channel-voice message (control change, program change, pitch bend, channel and polyphonic pressure).

AUMIDIBase routes these to per-type handlers whose defaults drop the message, so without this override a host's mod wheel, sustain, bank select, program change, pitch bend and aftertouch never reach the Processor. Notes keep going through HandleNoteOn/HandleNoteOff (including velocity-0 note-on as note-off), so their behaviour is unchanged.

◆ HandleNoteOff()

OSStatus pulp::format::au::PulpAUInstrument::HandleNoteOff ( UInt8 inChannel,
UInt8 inNoteNumber,
UInt8 inVelocity,
UInt32 inStartFrame )
override

◆ HandleNoteOn()

OSStatus pulp::format::au::PulpAUInstrument::HandleNoteOn ( UInt8 inChannel,
UInt8 inNoteNumber,
UInt8 inVelocity,
UInt32 inStartFrame )
override

◆ HandleSysEx()

OSStatus pulp::format::au::PulpAUInstrument::HandleSysEx ( const UInt8 * inData,
UInt32 inLength )
override

System-exclusive payload (F0 … F7).

MusicDeviceBase delivers this callback through the kMusicDeviceSysExSelect selector. AU v2 does not carry a per-event sample offset here, so the payload is queued at the start of the next Render block, matching the effect and MIDI processor adapters.

◆ Initialize()

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

◆ NewFactoryPresetSet()

OSStatus pulp::format::au::PulpAUInstrument::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.

◆ publish_parameter_display_changes()

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

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

◆ Render()

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

◆ RestoreState()

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

◆ SaveState()

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

◆ SetParameter()

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

◆ SetProperty()

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

◆ StreamFormatWritable()

bool pulp::format::au::PulpAUInstrument::StreamFormatWritable ( AudioUnitScope scope,
AudioUnitElement element )
override

◆ SupportedNumChannels()

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

◆ SupportsTail()

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

◆ ValidFormat()

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

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