79674671

Date: 2025-06-21 18:44:45
Score: 3.5
Natty:
Report link

I keep getting a jassert for checkForDuplicateParamID when compiling.

I followed this tutorial on building a preset manager.

All my parameters are declared in a Parameters.h file like this:

#pragma once
#include <JuceHeader.h>

const juce::ParameterID gainParamID { "gain", 1 };

class Parameters
{
public:
    Parameters(juce::AudioProcessorValueTreeState& apvts);
    
    static juce::AudioProcessorValueTreeState::ParameterLayout createParameterLayout();

private:
    juce::AudioParameterFloat* gainParam;
    //==============================================================================
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Parameters)
};

So the version hint is definitely in there. I don't have any errors. My JUCE project (in projucer) is set to version "1".

It's implemented like this:

layout.add(std::make_unique<juce::AudioParameterFloat>(
        gainParamID,
        "Output Gain",
        juce::NormalisableRange<float> { -12.0f, 12.0f },
        0.0f,
        juce::AudioParameterFloatAttributes().withStringFromValueFunction(stringFromDecibels)));

Adding in {"Output Gain", 1} after gainParamID throws an error (" Expected ')' "). The documentation says it's only in DEBUG mode, but I'd like to clear up this error before release.

Any ideas on how to resolve this? I much appreciate any input.

Reasons:
  • Blacklisted phrase (1): this tutorial
  • Blacklisted phrase (1): Any ideas
  • RegEx Blacklisted phrase (1.5): how to resolve this?
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: braintree