iPlug2 - C++ Audio Plug-in Framework
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 #if defined OS_WIN
32  #if defined _DEBUG
33  #if defined ARCH_64BIT
34  #pragma comment(lib, "AAXLibrary_x64_D.lib")
35  #else
36  #pragma comment(lib, "AAXLibrary_D.lib")
37  #endif
38  #else
39  #if defined ARCH_64BIT
40  #pragma comment(lib, "AAXLibrary_x64.lib")
41  #else
42  #pragma comment(lib, "AAXLibrary.lib")
43  #endif
44  #endif
45 #endif
46 
47 BEGIN_IPLUG_NAMESPACE
48 
49 const int kAAXParamIdxOffset = 1;
50 
52 struct InstanceInfo {};
53 
54 class IPlugAAX;
55 
57 class AAX_CEffectGUI_IPLUG : public AAX_CEffectGUI
58 {
59 public:
60  AAX_CEffectGUI_IPLUG() {}
61  ~AAX_CEffectGUI_IPLUG() {}
62  static AAX_IEffectGUI* AAX_CALLBACK Create();
63  AAX_Result SetControlHighlightInfo(AAX_CParamID iParameterID, AAX_CBoolean iIsHighlighted, AAX_EHighlightColor iColor);
64 
65 private:
66  void CreateViewContents();
67  void CreateViewContainer();
68  void DeleteViewContainer();
69  AAX_Result GetViewSize(AAX_Point *oEffectViewSize) const;
70  AAX_Result ParameterUpdated (const char* iParameterID);
71 private:
72  IPlugAAX* mPlug = nullptr;
73 };
74 
77 class IPlugAAX : public IPlugAPIBase
78  , public IPlugProcessor
79  , public AAX_CIPlugParameters
80 {
81 public:
82  IPlugAAX(const InstanceInfo& info, const Config& config);
83  ~IPlugAAX();
84 
85  //IPlugAPIBase Overrides
86  void BeginInformHostOfParamChange(int idx) override;
87  void InformHostOfParamChange(int idx, double normalizedValue) override;
88  void EndInformHostOfParamChange(int idx) override;
89 
90  void InformHostOfPresetChange() override { }; //NA
91 
92  bool EditorResize(int viewWidth, int viewHeight) override;
93 
95  virtual void GetTrackName(WDL_String& str) override { str = mTrackName; };
96 
97  //IPlug Processor Overrides
98  void SetLatency(int samples) override;
99  bool SendMidiMsg(const IMidiMsg& msg) override;
100 
101  AAX_Result UpdateParameterNormalizedValue(AAX_CParamID iParameterID, double iValue, AAX_EUpdateSource iSource) override;
102 
103  //AAX_CIPlugParameters Overrides
104  static AAX_CEffectParameters *AAX_CALLBACK Create();
105  AAX_Result EffectInit() override;
106  void RenderAudio(AAX_SIPlugRenderInfo* ioRenderInfo, const TParamValPair* inSynchronizedParamValues[], int32_t inNumSynchronizedParamValues) override;
107 
108  //AAX_CEffectParameters Overrides
109  AAX_Result GetChunkIDFromIndex(int32_t index, AAX_CTypeID* pChunkID) const override;
110  AAX_Result GetChunkSize(AAX_CTypeID chunkID, uint32_t* pChunkSize) const override;
111  AAX_Result GetChunk(AAX_CTypeID chunkID, AAX_SPlugInChunk* pChunk) const override;
112  AAX_Result SetChunk(AAX_CTypeID chunkID, const AAX_SPlugInChunk* pChunk) override;
113  AAX_Result CompareActiveChunk(const AAX_SPlugInChunk* pChunk, AAX_CBoolean* pIsEqual) const override;
114  AAX_Result NotificationReceived (AAX_CTypeID type, const void* data, uint32_t size) override;
115 
116  //IPlugAAX
119  void DirtyPTCompareState() { mNumPlugInChanges++; }
120 
121 private:
122  AAX_CParameter<bool>* mBypassParameter = nullptr;
123  AAX_ITransport* mTransport = nullptr;
124  WDL_PtrList<WDL_String> mParamIDs;
125  IMidiQueue mMidiOutputQueue;
126  int mMaxNChansForMainInputBus = 0;
127  WDL_String mTrackName;
128 };
129 
130 IPlugAAX* MakePlug(const InstanceInfo& info);
131 
132 #include "AAX_PopStructAlignment.h"
133 
134 END_IGRAPHICS_NAMESPACE
135 
136 #endif
The base class for IPlug Audio Processing.
The base class of an IPlug plug-in, which interacts with the different plug-in APIs.
Definition: IPlugAPIBase.h:42
A class to help with queuing timestamped MIDI messages.
Definition: IPlugMidi.h:677
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:119
Encapsulates a MIDI message and provides helper functions.
Definition: IPlugMidi.h:30
virtual void GetTrackName(WDL_String &str) override
Get the name of the track that the plug-in is inserted on.
Definition: IPlugAAX.h:95
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:77
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:90
The base class for IPlug Audio Processing.
The base class of an IPlug plug-in, which interacts with the different plug-in APIs.
MIDI and sysex structs/utilites.