Feature Request: AAXWrapper and AAX_CEffectGUI::SetControlHighlightInfo()

I’ve been asked to support Pro Tools’ automation control highlighting feature for a 3rd party project.

Pro Tools reports the automation state for a control/parameter via AAX_CEffectGUI::SetControlHighlightInfo(), so I guess one should implement AAXWrapper_GUI::SetControlHighlightInfo() to keep track of the automation state, accordingly. In order to come up with a respective patch/PR for your AAXWrapper, what would be a desirable way to go from there?

One idea would be to add a respective API to the IVst3ToAAXWrapper interface so my VST3 implementation can poll the automation state from there given that it’s running in an AAX environment? Would there be a better way?

Thanks,
Ray

I didn’t hear back from you, so here’s my proposal. The idea is to add an AAX specific function to the IVst3ToAAXWrapper interface so the plugin implementation can poll the control highlighting state whenever the developer wishes to. Another option would be to have a corresponding interface extension that may extend the IEditController implementation that an apropriate AAXWrapper_GUI::SetControlHighlightInfo() delegates to through your editor BaseWrapper. Please let me know whether this or a similar patch can be added in a future SDK update.

  1. Extend the IVst3ToAAXWrapper interface declaration in the following way:
class IVst3ToAAXWrapper : public FUnknown
{
public:
	virtual tresult PLUGIN_API getAutomationHighlight (int tag, int *color) = 0;

	//------------------------------------------------------------------------
	static const FUID iid;
};
DECLARE_CLASS_IID (IVst3ToAAXWrapper, 0x6D319DC6, 0x60C56242, 0xB32C951B, 0x93BEF4C6)

//------------------------------------------------------------------------

/**   Pro Tools automation highlighting colors
*/
enum AAXHighlightColor
{
	kHighlightColorNone = -1,
	kHighlightColorRed, // Corresponds to AAX_eHighlightColor_Red
	kHighlightColorBlue, // Corresponds to AAX_eHighlightColor_Blue
	kHighlightColorGreen, // Corresponds to AAX_eHighlightColor_Green
	kHighlightColorYellow // Corresponds to AAX_eHighlightColor_Yellow
};

This enables the plugin to retrieve the current highlighting color for all the controls corresponding to the parameter “tag”.

  1. Add a map that keeps track of the highlights to the AAX Wrapper (aaxwrapper.h):
// static creation method
	static AAXWrapper* create (Steinberg::IPluginFactory* factory,
	                           const Steinberg::TUID vst3ComponentID, AAX_Plugin_Desc* desc,
	                           AAXWrapper_Parameters* p);

...
	// IVst3ToAAXWrapper
	Steinberg::tresult PLUGIN_API getAutomationHighlight (int tag, int *color) SMTG_OVERRIDE;
...

private:
...
	std::map<int, int> automationHighlights;
  1. Implement “getAutomationHighlight()” e.g. (aaxwrapper.cpp):
...
tresult PLUGIN_API AAXWrapper::getAutomationHighlight(int tag, int *color)
{
	if (color != nullptr)
	{
		auto it = automationHighlights.find(tag);
		if (it != automationHighlights.end())
		{
			*color = it->second;
			return kResultTrue;
		}
	}
	return kResultFalse;
}
...
  1. Override and implement “SetControlHighlightInfo()” in aaxwrapper_gui.h / aaxwrapper_gui.cpp so it fills the map with the currently active highlights:
...
AAX_Result AAXWrapper_GUI::SetControlHighlightInfo(AAX_CParamID aaxid, AAX_CBoolean iIsHighlighted, AAX_EHighlightColor iColor)
{
	AAXWrapper* wrapper =
		static_cast<AAXWrapper_Parameters*> (GetEffectParameters())->getWrapper();

	// NOTE: One could make getVstParamID() a static helper function in AAXWrapper instead
	if (aaxid[0] != 'p')
		return AAX_ERROR_INVALID_PARAMETER_ID;
	Vst::ParamID id;
	if (sscanf(aaxid + 1, "%x", &id) != 1)
		return AAX_ERROR_INVALID_PARAMETER_ID;

	int color = kHighlightColorNone;

	if (iIsHighlighted)
	{
		switch(iColor)
		{
		case AAX_eHighlightColor_Red: color = kHighlightColorRed; break;
		case AAX_eHighlightColor_Blue: color = kHighlightColorBlue; break;
		case AAX_eHighlightColor_Green: color = kHighlightColorGreen; break;
		case AAX_eHighlightColor_Yellow: color = kHighlightColorYellow; break;
		}
	}

	wrapper->automationHighlights[id] = color;

	return AAX_SUCCESS;
}
...

Hi

we plan in the future to provide such feature to VST3… do not know when…but…

Maybe it would be better to do it like this:

class ISetControlHighlightInfo: public FUnknown
{
	virtual tresult PLUGIN_API setControlHighlightInfo (Vst::ParamID  id, TBool state, Vst::Color color) = 0; 
//------------------------------------------------------------------------
	static const FUID iid;
};
DECLARE_CLASS_IID (ISetControlHighlightInfo, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA)


//------------------------------------------------------------------------
AAX_Result AAXWrapper_GUI::SetControlHighlightInfo (AAX_CParamID iParameterID,
                                                    AAX_CBoolean iIsHighlighted,  AAX_EHighlightColor iColor)
{
	AAXWrapper* wrapper = static_cast<AAXWrapper_Parameters*> (GetEffectParameters ())->getWrapper ();
	if (mController)
	{
		// be sure that ISetControlHighlightInfo interface is implemented by your controller
		FUnknownPtr<ISetControlHighlightInfo> sci (mController);
		if (sci )
		{
			Vst::ParamID id = getVstParamID (iParameterID);
			if (id != -1)
				sci->setControlHighlightInfo (id, iIsHighlighted, getVst(Color (iColor));
		}
	}
	return AAX_SUCCESS;
}

Hi Yvan,

Thanks for getting back. That makes perfect sense, I’d prefer a solution like this anyway because it avoids polling. I’ll try to rework my suggestion according to your proposal when I find the time or just wait for it to materialize in one of the next SDK updates.

I remember there was a host API for retrieving the automation state back in the early VST2 days, but virtually no host ever supported it :slight_smile:

Best,
Ray