while trying to override some functions in a customized subclass of KnownPluginList, I observed that the functions in my subclass never got called. This first confused me, because I’m coming from an OO background where polymorphy is always on (in C++ terms: everything is virtual, always). Unfortunately I learned that C++ does not allow overriding of non-virtual functions.
I see the performance argument, especially for audio processing, however, for the more high-level and administrative classes in Juce, I would rather see at least some fundamental functions be declared as virtual, so we can modify their behavior in our own derived classes.
The reason I stumbled across this was that I want to exclude certain filename patterns in plugin names from being scanned (the plugin should not scan itself, as that would cause a mess). Therefore I re-implemented isListingUpToDate() and scanAndAddFile() in my derived class, such that it checks the filename and calls the superclass method else.
As I do not want to modify the library code (by inserting “virtual” keywords here and there), the only way to deal with this is probably to copy-paste the entire KnownPluginList class (or the PluginDirectoryScanner)?
I would also like to suggest that the “Hidden virtual function” compiler warning be enabled, and all 306 instances of this fixed in the library (by adding virtual keyword in derived classes too). This way one would be warned when re-implementing functions without knowing they are not virtual in the base class.
Any alternative to this?
Thanks again for the wonderful library. I am getting along with it greatly.