How to send flag between two independent plugins?


#1

Hello,
I am making two independent plugins, but I want one be able remote in some way from other plugin. It would be the best if I could send any int or enum.
Is it possible? If yes, how to do that in JUCE. Please help me.


#2

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


#3

Hey thanks that’s great. I always have difficult with finding anything in documentation


#4

OK, I’ve just found out I can’t use it without any tutorial. I just can’t understand the idea. And my English language is poor.
I need some instruction step by step how to do that. PLEASE, could any one help?


#5

First I just tried:
InterprocessConnection myConnection;

But it gives me two errors:
Field type ‘juce::InterprocessConnection’ is an abstract class

and:
Cannot initialize return object of type ‘juce::AudioProcessorEditor *’ with an rvalue of type myAudioProcessor.

Have no idea what to do.

So the first step looks for me too crazy to manage.


#6

I also tried in my editor constructor just call: InterprocessConnection();
But I get error:
Allocating an object of abstract class type ‘juce::InterprocessConnection’


#7

OK so if it’s abstract I understand I need to create my own class with InterprocessConnection as a base.


#8

OK I just tried to inherit from public InterprocessConnection in myAudioProcessorEditor.
But I get error in dependent class myAudioProcessor, exactly here:

AudioProcessorEditor* myAudioProcessor::createEditor()
{
    return new myAudioProcessorEditor (*this);
}

And the error says: Allocating an object of abstract class type ‘myAudioProcessor’.

Have no idea how to deal with that. Please give me some advice.


#9

https://docs.juce.com/master/classInterprocessConnection.html
Take a look at those three pure virtual functions. You might want to implement/override them :wink:


#10

Basic C++ stuff, the InterprocessConnection has pure virtual methods, you need to implement them in your subclass. (It probably isn’t a great idea to inherit your GUI class from it, by the way…)


#11

OK I found those function. What would I do without you. Great thanks.
By the way. Why it isn’t a great idea to inherit GUI class from InterprocessConnection. So which class do you recommend to inherit from it?


#12

That depends on the functionality you want to implement. In general, I would let the processor inherit from it, as it’s lifetime is longer than the editor’s. Or even better: write a new class to keep things tidy.

Another thing comes to mind: both of your plugin’s will probably end up running on the same process (your DAW), so not sure if InterProcessConnection is even necessary. However, not sure of a better alternative, maybe SharedResourcePointer? Or does it only work with two instances of the same plug-ins?


#13

OK, I will try, thanks.


#14

Only with multiple instances of the same plugin .dll. I think interprocess connection is needed if there are 2 different plugins involved, even if they are in the same process.

I wonder if a simpler solution would be to have 1 plugin that works in different modes?

Or even simpler, if this is supposed to be an analyzer for other plugins : just host the plugins to be analyzed in the analyzer plugin itself…


#15

Or does it only work with two instances of the same plug-ins?

N. It should works between two different plugins.

OK I just created my own class and inherited from InterprocessConnection. And override three abstract classes, and now it’s compiling properly. But those three classes are empty. I don’t know what to write there?

Other question:
Should I create the exactly the same or similar in my second plugin which i want to connect with?


#16

It’s not analyser of another plugin. I have plugin that calculate FFT of impulse response. Impulse is from other plugin. I want to give ability to change buffer size of FFT, but then I need my impulse generator plugin change his impulse buffe size also. And I want to make it happens automatically.


#17

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

Sorry, but you have to read it. All of it. Pipe. Socket. Open. Connect. …
Hint: you implement your desired functionality in those virtual methods.


#18

Sorry, but you have to read it. All of it. Pipe. Socket. Open. Connect. …

OK, you are right. I am just as always in harry, and have no patience. I will try to go through that. But thanks for hints, and for introduction :slight_smile:


#19

Hey danielrudrich
I tried to createPipe("MyUniquePluginName", -1, true)
And it returns false. So according to manual, the method will fail if the pipe already exists.
But I created it only in one of my plugin. So where it can exist? I use “Plugin Hos” JUCE example, and has there only that plugin (with createPipe), my other plugin (where I didn’t create pipe), and Fabfilter Pro_Q2. So it looks like Fabfilter has created his pipe? Or what?

OK, as I understand I still can create pipe without bool mustNotExist or just set it to false. But due to first behaviour described bym me, there are more than one pipe. So how can I say in my other plugin with which pipe it should connect? Does it connect if I use the same “MyUniquePluginName”? Or what?
But if “MyUniquePluginName” is ID of my pipe, then why createPipe("MyUniquePluginName", -1, true) gives me false? I am sure “MyUniquePluginName” is not exist in my computer. It’s strange, Polish string of words.


#20

And now I see even I still even didn’t open my another plugin, the method connectionMade() was called. What the hell I though. So i find there is function getConnectedHostName(). So I put it in connectionMade(). But it return: 127.0.0.1

And now I wonder: what the hell is it?

Please more hints :slight_smile: