iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
IPlugAAX.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the iPlug 2 library. Copyright (C) the iPlug 2 developers.
5
6 See LICENSE.txt for more info.
7
8 ==============================================================================
9*/
10
11#ifndef _IPLUGAPI_
12#define _IPLUGAPI_
13
20#include "IPlugPlatform.h"
21#include "IPlugAPIBase.h"
22#include "IPlugProcessor.h"
23#include "IPlugMidi.h"
24
25#include "IPlugAAX_Parameters.h"
26
27#include "AAX_CEffectGUI.h"
28
29#include "AAX_Push8ByteStructAlignment.h"
30
31// CMake handles linking via target_link_libraries, so skip pragma lib references
32#if defined OS_WIN && !defined IPLUG2_CMAKE_BUILD
33 #if defined _DEBUG
34 #if defined ARCH_64BIT
35 #pragma comment(lib, "AAXLibrary_x64_D.lib")
36 #else
37 #pragma comment(lib, "AAXLibrary_D.lib")
38 #endif
39 #else
40 #if defined ARCH_64BIT
41 #pragma comment(lib, "AAXLibrary_x64.lib")
42 #else
43 #pragma comment(lib, "AAXLibrary.lib")
44 #endif
45 #endif
46#endif
47
48BEGIN_IPLUG_NAMESPACE
49
50const int kAAXParamIdxOffset = 1;
51
53struct InstanceInfo {};
54
55class IPlugAAX;
56
58class AAX_CEffectGUI_IPLUG : public AAX_CEffectGUI
59{
60public:
61 AAX_CEffectGUI_IPLUG() {}
62 ~AAX_CEffectGUI_IPLUG() {}
63 static AAX_IEffectGUI* AAX_CALLBACK Create();
64 AAX_Result SetControlHighlightInfo(AAX_CParamID iParameterID, AAX_CBoolean iIsHighlighted, AAX_EHighlightColor iColor);
65
66private:
67 void CreateViewContents();
68 void CreateViewContainer();
69 void DeleteViewContainer();
70 AAX_Result GetViewSize(AAX_Point *oEffectViewSize) const;
71 AAX_Result ParameterUpdated (const char* iParameterID);
72private:
73 IPlugAAX* mPlug = nullptr;
74};
75
78class IPlugAAX : public IPlugAPIBase
79 , public IPlugProcessor
80 , public AAX_CIPlugParameters
81{
82public:
83 IPlugAAX(const InstanceInfo& info, const Config& config);
84 ~IPlugAAX();
85
86 //IPlugAPIBase Overrides
87 void BeginInformHostOfParamChange(int idx) override;
88 void InformHostOfParamChange(int idx, double normalizedValue) override;
89 void EndInformHostOfParamChange(int idx) override;
90
91 void InformHostOfPresetChange() override { }; //NA
92
93 bool EditorResize(int viewWidth, int viewHeight) override;
94
96 virtual void GetTrackName(WDL_String& str) override { str = mTrackName; };
97
98 //IPlug Processor Overrides
99 void SetLatency(int samples) override;
100 bool SendMidiMsg(const IMidiMsg& msg) override;
101
102 AAX_Result UpdateParameterNormalizedValue(AAX_CParamID iParameterID, double iValue, AAX_EUpdateSource iSource) override;
103
104 //AAX_CIPlugParameters Overrides
105 static AAX_CEffectParameters *AAX_CALLBACK Create();
106 AAX_Result EffectInit() override;
107 void RenderAudio(AAX_SIPlugRenderInfo* ioRenderInfo, const TParamValPair* inSynchronizedParamValues[], int32_t inNumSynchronizedParamValues) override;
108
109 //AAX_CEffectParameters Overrides
110 AAX_Result GetChunkIDFromIndex(int32_t index, AAX_CTypeID* pChunkID) const override;
111 AAX_Result GetChunkSize(AAX_CTypeID chunkID, uint32_t* pChunkSize) const override;
112 AAX_Result GetChunk(AAX_CTypeID chunkID, AAX_SPlugInChunk* pChunk) const override;
113 AAX_Result SetChunk(AAX_CTypeID chunkID, const AAX_SPlugInChunk* pChunk) override;
114 AAX_Result CompareActiveChunk(const AAX_SPlugInChunk* pChunk, AAX_CBoolean* pIsEqual) const override;
115 AAX_Result NotificationReceived (AAX_CTypeID type, const void* data, uint32_t size) override;
116
117 //IPlugAAX
120 void DirtyPTCompareState() { mNumPlugInChanges++; }
121
122private:
123 AAX_CParameter<bool>* mBypassParameter = nullptr;
124 AAX_ITransport* mTransport = nullptr;
125 WDL_PtrList<WDL_String> mParamIDs;
126 IMidiQueue mMidiOutputQueue;
127 int mMaxNChansForMainInputBus = 0;
128 WDL_String mTrackName;
129};
130
131IPlugAAX* MakePlug(const InstanceInfo& info);
132
133#include "AAX_PopStructAlignment.h"
134
135END_IGRAPHICS_NAMESPACE
136
137#endif
MIDI and sysex structs/utilites.
Include to get consistently named preprocessor macros for different platforms and logging functionali...
AAX API base class for an IPlug plug-in.
Definition: IPlugAAX.h:81
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!
Definition: IPlugAAX.cpp:611
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...
Definition: IPlugAAX.cpp:574
void DirtyPTCompareState()
This is needed in chunks based plug-ins to tell PT a non-indexed param changed and to turn on the com...
Definition: IPlugAAX.h:120
void InformHostOfParamChange(int idx, double normalizedValue) override
Implemented by the API class, called by the UI via SetParameterValue() with the value of a parameter ...
Definition: IPlugAAX.cpp:568
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...
Definition: IPlugAAX.cpp:562
virtual void GetTrackName(WDL_String &str) override
Get the name of the track that the plug-in is inserted on.
Definition: IPlugAAX.h:96
void SetLatency(int samples) override
Call this if the latency of your plug-in changes after initialization (perhaps from OnReset() ) This ...
Definition: IPlugAAX.cpp:604
bool EditorResize(int viewWidth, int viewHeight) override
Implementations call into the APIs resize hooks returns a bool to indicate whether the DAW or plugin ...
Definition: IPlugAAX.cpp:580
void InformHostOfPresetChange() override
Implemented by the API class, called by the UI (etc) when the plug-in initiates a program/preset chan...
Definition: IPlugAAX.h:91
The base class of an IPlug plug-in, which interacts with the different plug-in APIs.
Definition: IPlugAPIBase.h:43
The base class for IPlug Audio Processing.
Encapsulates a MIDI message and provides helper functions.
Definition: IPlugMidi.h:31