I have a class which inherits AudioSource.
From looking at a class from the Juce API which also inherits AudioSource I see that it uses a macro in the private section of the header.
Do I need this?
If so, I really don’t know how do it. I have a problem with the namespace here, in particular using the namespace together with macros.
Wrapping the definitions of my class in
BEGIN_JUCE_NAMESPACE
END_JUCE_NAMESPACE
is not an option.
I tried this
juce::JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (classname);
but, no luck, I guess this does not work because JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR is a macro.
And, should I do a similar thing for the “NON_COPYABLE part” of
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
? I mean, the macro is somehow combining 2 macros.
(From the documentation:
Easiest thing would just be to fix that definition in the juce codebase and use the macro normally, rather than typing out the whole thing in your own code. I’ll update it next time I do a check-in anyway.
eh? Don’t redefine it in your code, just fix the original version of it - I’m going to fix it anyway, so in the meantime you could just patch your copy so you can use it.