getRawParameterValue
returns a float*
and you’re attempting to store it in an int*
.
If you want to obtain an AudioParameterInt
object from an APVTS could instead do something like:
parameters(*this, nullptr, Identifier("APVTSTutorial"),
{
std::make_unique<AudioParameterFloat>("test_float", // parameter ID
"test float", // parameter name
0.0f, // minimum value
1.0f, // maximum value
0.5f), // default value
std::make_unique<AudioParameterInt> ("test_int", // parameter ID
"test int", // parameter name
0.0f, // minimum value
1.0f, // maximum value
0.5f) // default value
}),
intParam (*dynamic_cast<AudioParameterInt*> (parameters.getParameter ("test_int")))
{
// Constructor...
int intValue = intParam;
}
// Members
AudioProcessorValueTreeState parameters;
AudioParameterInt& intParam;