21#include <unordered_map>
23#include <CoreAudio/CoreAudioTypes.h>
26#include "assocarray.h"
47 IPlugAUv3(
const InstanceInfo& info,
const Config& config);
59 bool EditorResize(
int viewWidth,
int viewHeight)
override;
62 void ProcessWithEvents(AudioTimeStamp
const* timestamp, uint32_t frameCount, AURenderEvent
const* events,
ITimeInfo& timeInfo);
63 void SetParameterFromValueObserver(uint64_t address,
float value);
64 void SendParameterValueFromObserver(uint64_t address,
float value);
65 float GetParameter(uint64_t address);
66 const char* GetParamDisplay(uint64_t address,
float value);
67 float GetParamStringToValue(uint64_t address,
const char* str);
68 void AttachInputBuffers(AudioBufferList* pInBufferList);
69 void AttachOutputBuffers(AudioBufferList* pOutBufferList, uint32_t busNumber);
70 void Prepare(
double sampleRate, uint32_t blockSize);
71 void AddParamAddress(
int paramIdx, uint64_t paramAddress)
73 mParamAddressMap.insert({paramIdx, paramAddress});
74 mAddressParamMap.insert({paramAddress, paramIdx});
77 uint64_t GetParamAddress(
int paramIdx) {
return mParamAddressMap[paramIdx]; }
78 int GetParamIdx(uint64_t paramAddress) {
return mAddressParamMap[paramAddress]; }
80 void SetAUAudioUnit(
void* pAUAudioUnit);
82 void SetOffline(
bool renderingOffline) { IPlugProcessor::SetRenderingOffline(renderingOffline); }
84#pragma mark - Specialist Use
86 virtual void* GetNamedMessageChannel(
const char* name) {
return nullptr; }
96 std::unordered_map<int, uint64_t> mParamAddressMap;
97 std::unordered_map<uint64_t, int> mAddressParamMap;
98 void* mAUAudioUnit =
nullptr;
99 AudioTimeStamp mLastTimeStamp;
102IPlugAUv3* MakePlug(
const InstanceInfo& info);
The base class of an IPlug plug-in, which interacts with the different plug-in APIs.
AudioUnit v3 API base class for an IPlug plug-in.
void InformHostOfParamChange(int idx, double normalizedValue) override
Implemented by the API class, called by the UI via SetParameterValue() with the value of a parameter ...
bool SendSysEx(const ISysEx &msg) override
Send a single MIDI System Exclusive (SysEx) message // TODO: info about what thread should this be ca...
bool SendMidiMsg(const IMidiMsg &msg) override
Send a single MIDI message // TODO: info about what thread should this be called on or not called on!
bool EditorResize(int viewWidth, int viewHeight) override
Implementations call into the APIs resize hooks returns a bool to indicate whether the DAW or plugin ...
void BeginInformHostOfParamChange(int idx) override
Implemented by the API class, called by the UI (or by a delegate) at the beginning of a parameter cha...
const AudioTimeStamp & GetLastAudioTimeStamp() const
Get the AudioTimeStamp from the last render callback.
void EndInformHostOfParamChange(int idx) override
Implemented by the API class, called by the UI (or by a delegate) at the end of a parameter change ge...
void InformHostOfPresetChange() override
Implemented by the API class, called by the UI (etc) when the plug-in initiates a program/preset chan...
The base class for IPlug Audio Processing.
Encapsulates information about the host transport state.
Encapsulates a MIDI message and provides helper functions.
A struct for dealing with SysEx messages.