static auto createParameter (const AudioProcessorParameter& parameter)
{
...
auto getParameterIdentifier = [¶meter]
{
if (const auto* paramWithID = dynamic_cast<const AudioProcessorParameterWithID*> (¶meter))
return paramWithID->paramID;
// This could clash if any groups have been given integer IDs!
return String (parameter.getParameterIndex());
};
...
}
The dynamic cast should be to the base class that provides the accessor to the thing wanted, here is what I would have expected:
auto getParameterIdentifier = [¶meter]
{
if (const auto* paramWithID = dynamic_cast<const HostedAudioProcessorParameter*> (¶meter))
return paramWithID->getParameterID();
// This could clash if any groups have been given integer IDs!
return String (parameter.getParameterIndex());
};