How to recognize host in plugin


#1

Hello,
How to write macro #if that recognize the plugin is launched in Logic Pro?

I am at all totally new with macros in C++. I now what they are, and what they do mainly, I even sometimes use #define, but that’s all :slight_smile:

Now I need to write some code that will be executed only if plugin is launched in Logic Pro. Is that possible?

I tried to find something in documentation, like #if Logic Pro, or something like that, but I didn’t find anything.

For any help thanks in advance.


#2

How would it work with a macro? That’s a compile time construct. You need to detect the host at runtime.

You need to use :

https://docs.juce.com/master/classPluginHostType.html


#3

thanks. So macros are used only when compiling and building?