Conversions between enumeration and floating point
Opened this issue · 1 comments
Greetings.
I was learning from your tutorial step-by-step on YouTube. Clear explanations.
However, some errors occurred when getting chain settings on my VS 2017:
simpleeq-master\source\pluginprocessor.cpp(241): note: Conversions between enumeration and floating point values are no longer allowed
I believe that this occurs because getRawParameterValue() returns a pointer to std::atomic float, and load() simply returns a float, which is no longer avaliable for enumeration indexing.
Add another casting such as
static_cast<Slope>((int)apvts.getRawParameterValue("LowCut` Slope")->load());
should help, just some humble opinion. (Tested on VS 2017, LGTM)
Thanks again for your outstanding project.
he error message you're seeing suggests that there's a problem with converting between enumeration and floating-point values. This typically happens when you're trying to use a floating-point value where an enumeration is expected, or vice versa.
static_cast<Slope>((int)apvts.getRawParameterValue("LowCut Slope")->load());
You're explicitly casting the result of load() to an integer and then to the Slope enumeration. This can help resolve the issue if the Slope enumeration corresponds to integer values and the load() method indeed returns a floating-point value that represents an integer (e.g., 0.0, 1.0, 2.0, ...). This casting ensures that the value from load() is first converted to an integer before being cast to the enumeration.
Just make sure that the Slope enumeration's values are indeed integer values and that the values returned by load() correspond to those enum values. Also, keep in mind that if you encounter similar issues in other parts of your codebase, similar type casting might be needed.