1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-22 01:34:21 +00:00

Check for hash collisions when generating integer parameter ids from parameter id strings

This commit is contained in:
hogliux 2016-07-10 10:10:20 +01:00
parent 5e9c2566e3
commit 872f84dfd9
3 changed files with 13 additions and 0 deletions

View file

@ -1578,6 +1578,10 @@ private:
{
const AudioUnitParameterID auParamID = generateAUParameterIDForIndex (i);
// Consider yourself very unlucky if you hit this assertion. The hash code of your
// parameter ids are not unique.
jassert (! paramMap.contains (static_cast<int32> (auParamID)));
auParamIDs.add (auParamID);
paramMap.set (static_cast<int32> (auParamID), i);

View file

@ -845,6 +845,11 @@ private:
AUParameterAddress address = static_cast<AUParameterAddress> (idx);
#else
AUParameterAddress address = generateAUParameterAddressForIndex (idx);
// Consider yourself very unlucky if you hit this assertion. The hash code of your
// parameter ids are not unique.
jassert (! paramMap.contains (static_cast<int64> (address)));
paramAddresses.add (address);
paramMap.set (static_cast<int64> (address), idx);
#endif

View file

@ -2093,6 +2093,10 @@ private:
{
const Vst::ParamID paramID = JuceVST3EditController::generateVSTParamIDForIndex (pluginInstance, i);
// Consider yourself very unlucky if you hit this assertion. The hash code of your
// parameter ids are not unique.
jassert (! vstParamIDs.contains (static_cast<int32> (paramID)));
vstParamIDs.add (paramID);
paramMap.set (static_cast<int32> (paramID), i);
}