I’m a bit confused. There seems to be two completely different paradigms for parameters and their visualisation and the newer paradigm seems to break Juce own Coding Standard and is also hard to understand from a design perspective.
In the tutorial Control audio levels parameters and their gui-controller are added as actual members to some main class (in this case an inheritor of AudioAppComponent). It’s corresponding slider and the sliders size etc are set in the constructor and
resized(). All fine I understand how this works.
But in the tutorial Adding plug-in parameters a completely different paradigm is used, where the parameter instead is a pointer and must(?) be initialized with a
new. Since projects often have a lot of parameters there’s going to be a lot of
new but the Coding Standard says:
“Do not use
newunless there’s no alternative. Whenever you type
new, always treat it as a failure to find a better solution.”
So this is a failure? I read in the tutorial explaining why it’s “safe” to use raw pointers in this case and I’m sure that’s correct but what is the actual benefit on making raw pointers in the first place when it’s not recommended and there was already a solution not using raw pointers?
Also this parameter is only a parameter with no obvious connection to the design of it’s control (a slider in this case) so I have no clue on where to go to alter the design , size e.t.c. of the slider.
To me the “old style” seems much more direct, useful and nice looking but of course if there’s a huge drawback I miss here I will use the new standard. What would that be? And anyone who can point me to the direction of understanding how to resize and design the corresponding gui-component to a AudioParameter-pointer?