|
@@ -63,7 +63,8 @@ class CarlaEngineNativeUI : public CarlaExternalUI |
|
|
{ |
|
|
{ |
|
|
public: |
|
|
public: |
|
|
CarlaEngineNativeUI(CarlaEngine* const engine) |
|
|
CarlaEngineNativeUI(CarlaEngine* const engine) |
|
|
: fEngine(engine) |
|
|
|
|
|
|
|
|
: fEngine(engine), |
|
|
|
|
|
fIsReady(false) |
|
|
{ |
|
|
{ |
|
|
carla_debug("CarlaEngineNativeUI::CarlaEngineNativeUI(%p)", engine); |
|
|
carla_debug("CarlaEngineNativeUI::CarlaEngineNativeUI(%p)", engine); |
|
|
} |
|
|
} |
|
@@ -73,6 +74,11 @@ public: |
|
|
carla_debug("CarlaEngineNativeUI::~CarlaEngineNativeUI()"); |
|
|
carla_debug("CarlaEngineNativeUI::~CarlaEngineNativeUI()"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool isReady() const noexcept |
|
|
|
|
|
{ |
|
|
|
|
|
return fIsReady; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
protected: |
|
|
protected: |
|
|
bool msgReceived(const char* const msg) noexcept override |
|
|
bool msgReceived(const char* const msg) noexcept override |
|
|
{ |
|
|
{ |
|
@@ -536,6 +542,10 @@ protected: |
|
|
if (CarlaPlugin* const plugin = fEngine->getPlugin(pluginId)) |
|
|
if (CarlaPlugin* const plugin = fEngine->getPlugin(pluginId)) |
|
|
plugin->showCustomUI(yesNo); |
|
|
plugin->showCustomUI(yesNo); |
|
|
} |
|
|
} |
|
|
|
|
|
else if (std::strcmp(msg, "ready") == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
fIsReady = true; |
|
|
|
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
carla_stderr("CarlaEngineNativeUI::msgReceived : %s", msg); |
|
|
carla_stderr("CarlaEngineNativeUI::msgReceived : %s", msg); |
|
@@ -555,6 +565,7 @@ protected: |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
CarlaEngine* const fEngine; |
|
|
CarlaEngine* const fEngine; |
|
|
|
|
|
bool fIsReady; |
|
|
|
|
|
|
|
|
void _updateParamValues(CarlaPlugin* const plugin, const uint32_t pluginId) const noexcept |
|
|
void _updateParamValues(CarlaPlugin* const plugin, const uint32_t pluginId) const noexcept |
|
|
{ |
|
|
{ |
|
@@ -577,7 +588,8 @@ public: |
|
|
fIsActive(false), |
|
|
fIsActive(false), |
|
|
fIsRunning(false), |
|
|
fIsRunning(false), |
|
|
fUiServer(this), |
|
|
fUiServer(this), |
|
|
fOptionsForced(false) |
|
|
|
|
|
|
|
|
fOptionsForced(false), |
|
|
|
|
|
fWaitForReadyMsg(false) |
|
|
{ |
|
|
{ |
|
|
carla_debug("CarlaEngineNative::CarlaEngineNative()"); |
|
|
carla_debug("CarlaEngineNative::CarlaEngineNative()"); |
|
|
|
|
|
|
|
@@ -1498,6 +1510,16 @@ protected: |
|
|
|
|
|
|
|
|
if (kIsPatchbay) |
|
|
if (kIsPatchbay) |
|
|
patchbayRefresh(false); |
|
|
patchbayRefresh(false); |
|
|
|
|
|
|
|
|
|
|
|
if (fWaitForReadyMsg) |
|
|
|
|
|
{ |
|
|
|
|
|
carla_stdout("Using Carla plugin embedded in Tracktion, waiting for it to be ready..."); |
|
|
|
|
|
|
|
|
|
|
|
for (; fUiServer.isPipeRunning() && ! fUiServer.isReady();) |
|
|
|
|
|
fUiServer.idlePipe(); |
|
|
|
|
|
|
|
|
|
|
|
carla_stdout("Done!"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@@ -1751,6 +1773,8 @@ public: |
|
|
switch(opcode) |
|
|
switch(opcode) |
|
|
{ |
|
|
{ |
|
|
case NATIVE_PLUGIN_OPCODE_NULL: |
|
|
case NATIVE_PLUGIN_OPCODE_NULL: |
|
|
|
|
|
if (static_cast<uint32_t>(index) == 0xDEADF00D && value == 0xC0C0B00B) |
|
|
|
|
|
handlePtr->fWaitForReadyMsg = true; |
|
|
return 0; |
|
|
return 0; |
|
|
case NATIVE_PLUGIN_OPCODE_BUFFER_SIZE_CHANGED: |
|
|
case NATIVE_PLUGIN_OPCODE_BUFFER_SIZE_CHANGED: |
|
|
CARLA_SAFE_ASSERT_RETURN(value > 0, 0); |
|
|
CARLA_SAFE_ASSERT_RETURN(value > 0, 0); |
|
@@ -1794,6 +1818,7 @@ private: |
|
|
CarlaEngineNativeUI fUiServer; |
|
|
CarlaEngineNativeUI fUiServer; |
|
|
|
|
|
|
|
|
bool fOptionsForced; |
|
|
bool fOptionsForced; |
|
|
|
|
|
bool fWaitForReadyMsg; |
|
|
char fTmpBuf[STR_MAX+1]; |
|
|
char fTmpBuf[STR_MAX+1]; |
|
|
|
|
|
|
|
|
CarlaPlugin* _getFirstPlugin() const noexcept |
|
|
CarlaPlugin* _getFirstPlugin() const noexcept |
|
|