Browse Source

AU: Replaced std::unordered_map with HashMap for parameter lookup

tags/2021-05-28
ed 8 years ago
parent
commit
94e8a43a95
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm

+ 7
- 7
modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm View File

@@ -53,8 +53,6 @@
#include <CoreAudioKit/AUViewController.h>
#endif
#include <unordered_map>
#if JUCE_SUPPORT_CARBON
#include "../../juce_gui_extra/native/juce_mac_CarbonViewWrapperComponent.h"
#endif
@@ -1185,7 +1183,7 @@ public:
ParamInfo* const param = new ParamInfo();
parameters.add (param);
param->paramID = ids[i];
paramIDToIndex[ids[i]] = i;
paramIDToIndex.getReference (ids[i]) = i;
param->minValue = info.minValue;
param->maxValue = info.maxValue;
param->automatable = (info.flags & kAudioUnitParameterFlag_NonRealTime) == 0;
@@ -1281,7 +1279,7 @@ private:
};
OwnedArray<ParamInfo> parameters;
std::unordered_map<AudioUnitParameterID, size_t> paramIDToIndex;
HashMap<AudioUnitParameterID, size_t> paramIDToIndex;
MidiDataConcatenator midiConcatenator;
CriticalSection midiInLock;
@@ -1367,10 +1365,12 @@ private:
|| event.mEventType == kAudioUnitEvent_BeginParameterChangeGesture
|| event.mEventType == kAudioUnitEvent_EndParameterChangeGesture)
{
auto it = paramIDToIndex.find (event.mArgument.mParameter.mParameterID);
auto paramID = event.mArgument.mParameter.mParameterID;
if (! paramIDToIndex.contains (paramID))
return;
if (it != paramIDToIndex.end())
paramIndex = (int) it->second;
paramIndex = static_cast<int> (paramIDToIndex [paramID]);
if (! isPositiveAndBelow (paramIndex, parameters.size()))
return;


Loading…
Cancel
Save