mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
AU Client: Switch HashMap to unordered_map
This commit is contained in:
parent
7068e70758
commit
3d38ca764e
1 changed files with 10 additions and 6 deletions
|
|
@ -1812,7 +1812,7 @@ private:
|
|||
|
||||
//==============================================================================
|
||||
LegacyAudioParametersWrapper juceParameters;
|
||||
HashMap<int32, AudioProcessorParameter*> paramMap;
|
||||
std::unordered_map<int32, AudioProcessorParameter*> paramMap;
|
||||
Array<AudioUnitParameterID> auParamIDs;
|
||||
Array<const AudioProcessorParameterGroup*> parameterGroups;
|
||||
|
||||
|
|
@ -2057,10 +2057,10 @@ private:
|
|||
|
||||
// Consider yourself very unlucky if you hit this assertion. The hash codes of your
|
||||
// parameter ids are not unique.
|
||||
jassert (! paramMap.contains (static_cast<int32> (auParamID)));
|
||||
jassert (paramMap.find (static_cast<int32> (auParamID)) == paramMap.end());
|
||||
|
||||
auParamIDs.add (auParamID);
|
||||
paramMap.set (static_cast<int32> (auParamID), param);
|
||||
paramMap.emplace (static_cast<int32> (auParamID), param);
|
||||
Globals()->SetParameter (auParamID, param->getValue());
|
||||
}
|
||||
}
|
||||
|
|
@ -2141,9 +2141,13 @@ private:
|
|||
|
||||
AudioProcessorParameter* getParameterForAUParameterID (AudioUnitParameterID address) const noexcept
|
||||
{
|
||||
auto index = static_cast<int32> (address);
|
||||
return forceUseLegacyParamIDs ? juceParameters.getParamForIndex (index)
|
||||
: paramMap[index];
|
||||
const auto index = static_cast<int32> (address);
|
||||
|
||||
if (forceUseLegacyParamIDs)
|
||||
return juceParameters.getParamForIndex (index);
|
||||
|
||||
const auto iter = paramMap.find (index);
|
||||
return iter != paramMap.end() ? iter->second : nullptr;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue