Auto-determine bool isMidiEffect()?

I’ve seen it mentioned in various places that if you create a MIDI effect, you specifically need to override isMidiEffect() manually to true. This is not immediately obvious and the assertion failure from not doing so doesn’t point you in the right direction.

What I couldn’t find was why this isn’t done automatically by default as follows:

bool isMidiEffect() const override
#if JucePlugin_IsMidiEffect
  return true;
  return false;

Surely this would take care of it? Or are you trying to discourage people from ticking this box because of certain plugin format quirks, or for some other reason? If so, I think this should be more transparent.

Thoughts? :slight_smile:

This has already been added to the audio plug-in template provided by the Projucer:

It’s only on the develop branch for now, so you’ll need to rebuild the Projucer to get it.

Oh wow, classic! Thanks @t0m and sorry for the duplicate.