Proper OSC remote control implementation, allowed on standalones
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
0ad791dee0
commit
3d44fb9d79
5 changed files with 192 additions and 34 deletions
|
|
@ -167,7 +167,6 @@ struct ScopedContext {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
|
||||
class CardinalPlugin : public CardinalBasePlugin
|
||||
|
|
@ -333,7 +332,7 @@ public:
|
|||
|
||||
~CardinalPlugin() override
|
||||
{
|
||||
#ifdef CARDINAL_INIT_OSC_THREAD
|
||||
#ifdef HAVE_LIBLO
|
||||
if (fInitializer->remotePluginInstance == this)
|
||||
fInitializer->remotePluginInstance = nullptr;
|
||||
#endif
|
||||
|
|
@ -359,6 +358,37 @@ public:
|
|||
return context;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBLO
|
||||
bool startRemoteServer(const char* const port) override
|
||||
{
|
||||
if (fInitializer->remotePluginInstance != nullptr)
|
||||
return false;
|
||||
|
||||
if (fInitializer->startRemoteServer(port))
|
||||
{
|
||||
fInitializer->remotePluginInstance = this;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void stopRemoteServer() override
|
||||
{
|
||||
DISTRHO_SAFE_ASSERT_RETURN(fInitializer->remotePluginInstance == this,);
|
||||
|
||||
fInitializer->remotePluginInstance = nullptr;
|
||||
fInitializer->stopRemoteServer();
|
||||
}
|
||||
|
||||
void stepRemoteServer() override
|
||||
{
|
||||
DISTRHO_SAFE_ASSERT_RETURN(fInitializer->remotePluginInstance == this,);
|
||||
|
||||
fInitializer->stepRemoteServer();
|
||||
}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
/* --------------------------------------------------------------------------------------------------------
|
||||
* Information */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue