Is there a way to figure out if the SC key input of an AAX plugin has been selected?
For instance:
[no key input set]
vs
[key input set]
… is there any clear-cut getKeyInputSet() function for AAX? I know in the documentation of AAX SDK, it says that the SC input pointer will be null if there is none set, but my getReadPointers() / getWritePionters() are not null.
Thanks for any help!
EDIT: Solved!*
Here’s how you get a notification when it’s set or unset - it’s really pretty simple and only takes a couple of minutes to get working. It will also signal that it is not connected when an unused bus is specified. It will only signal ‘connected’ when you have a valid SC signal!
Note: This technique involves modifying a default JUCE file named:
juce_AAX_Wrapper.cpp
1. To start, open juce_AAX_Wrapper.cpp (this may be in your Program FIles directory)
2. Scroll down and find the line with the following function on it:
AAX_Result NotificationReceived (AAX_CTypeID type, const void* data, uint32_t size) override
This is the code PT uses when certain things change, such as SideChain’s being connected.
3. Add the following to the function body:
{
…
if (type == AAX_eNotificationEvent_SideChainBeingConnected) pluginInstance->AAX_SC_Connected(true);
if (type == AAX_eNotificationEvent_SideChainBeingDisconnected) pluginInstance->AAX_SC_Connected(false);
…
}
4. Now, we have to add a new line to the JUCE file:
juce_AudioProcessor.h
which is
class JUCE_API AudioProcessor
{
…
public: virtual void AAX_SC_Connected(bool v) { }
…
}
Now, we’re all set with the message relaying, we need to actually decide what happens within our plugin:
5. Open your 'PluginProcessor.h" file and add the line to your class:
class MyPlugin : public AudioProcessor
{
…
void AAX_SC_Connected(bool v) override;
}
6. Final step - open “PluginProcessor.cpp” and add the following line:
void MyPlugin::AAX_SC_Connected(bool v)
{
//THE CODE YOU WANT TO HAPPEN
// v == true when good connection is made
// v == false when no sc/unused bus is made
}