Unfortunately, if PluginEditor is a GUI component then there is no way to encapsulate CameraDevice with #ifdef’s since Projucer will always overwrite this upon re-saving. Therefore, I believe that having two .jucer files, (one with the camera device enabled, the other disabled), which refer to their own PluginEditor copies (one that inherits cameraDevice, and one that does not), is the only solution at the moment.
//==============================================================================
/**
//[Comments]
An auto-generated component, created by the Introjucer.
Describe your class and how it works here!
//[/Comments]
*/
class PluginEditor : public AudioProcessorEditor,
public MultiTimer,
public AsyncUpdater,
private CameraDevice::Listener,
public juce::ComboBox::Listener,
public juce::Slider::Listener,
public juce::Button::Listener
{
public:
//==============================================================================
PluginEditor (PluginProcessor* ownerFilter);
~PluginEditor() override;
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
//[/UserMethods]
But it is what it is… WebCam support is not (and probably shouldn’t be) a top priority for an audio focused framework, and I’m happy to patiently wait until it is eventually added (I waited 2 years for the MacOS webcam support to be fixed after-all ;).
I just wanted to pitch in and demonstrate a legitimate (although perhaps rather niche) use for the webcam in the context of audio, and also make it known that one more guy would like to see this brought to Linux when at all possible 