mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
AAX: Inform host of more parameter attributes when audio processor calls updateHostDisplay
This commit is contained in:
parent
d564e49312
commit
c07a77a8f9
1 changed files with 37 additions and 12 deletions
|
|
@ -1162,18 +1162,9 @@ namespace AAXClasses
|
|||
|
||||
if (details.parameterInfoChanged)
|
||||
{
|
||||
auto numParameters = juceParameters.getNumParameters();
|
||||
|
||||
for (int i = 0; i < numParameters; ++i)
|
||||
{
|
||||
if (auto* p = mParameterManager.GetParameterByID (getAAXParamIDFromJuceIndex (i)))
|
||||
{
|
||||
auto newName = juceParameters.getParamForIndex (i)->getName (31);
|
||||
|
||||
if (p->Name() != newName.toRawUTF8())
|
||||
p->SetName (AAX_CString (newName.toRawUTF8()));
|
||||
}
|
||||
}
|
||||
for (const auto* param : juceParameters)
|
||||
if (auto* aaxParam = mParameterManager.GetParameterByID (getAAXParamIDFromJuceIndex (param->getParameterIndex())))
|
||||
syncParameterAttributes (aaxParam, param);
|
||||
}
|
||||
|
||||
if (details.latencyChanged)
|
||||
|
|
@ -2064,6 +2055,40 @@ namespace AAXClasses
|
|||
return defaultLayout;
|
||||
}
|
||||
|
||||
void syncParameterAttributes (AAX_IParameter* aaxParam, const AudioProcessorParameter* juceParam)
|
||||
{
|
||||
if (juceParam == nullptr)
|
||||
return;
|
||||
|
||||
{
|
||||
auto newName = juceParam->getName (31);
|
||||
|
||||
if (aaxParam->Name() != newName.toRawUTF8())
|
||||
aaxParam->SetName (AAX_CString (newName.toRawUTF8()));
|
||||
}
|
||||
|
||||
{
|
||||
auto newType = juceParam->isDiscrete() ? AAX_eParameterType_Discrete : AAX_eParameterType_Continuous;
|
||||
|
||||
if (aaxParam->GetType() != newType)
|
||||
aaxParam->SetType (newType);
|
||||
}
|
||||
|
||||
{
|
||||
auto newNumSteps = static_cast<uint32_t> (juceParam->getNumSteps());
|
||||
|
||||
if (aaxParam->GetNumberOfSteps() != newNumSteps)
|
||||
aaxParam->SetNumberOfSteps (newNumSteps);
|
||||
}
|
||||
|
||||
{
|
||||
auto defaultValue = juceParam->getDefaultValue();
|
||||
|
||||
if (! approximatelyEqual (static_cast<float> (aaxParam->GetNormalizedDefaultValue()), defaultValue))
|
||||
aaxParam->SetNormalizedDefaultValue (defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
ScopedJuceInitialiser_GUI libraryInitialiser;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue