Browse Source

Fix main client name for multiple carlas inside NSM

Closes #1279

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.3.0
falkTX 3 years ago
parent
commit
2a6a7de04f
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
5 changed files with 24 additions and 13 deletions
  1. +6
    -1
      source/backend/CarlaBackend.h
  2. +9
    -0
      source/backend/CarlaStandaloneNSM.cpp
  3. +1
    -11
      source/backend/engine/CarlaEngineJack.cpp
  4. +3
    -0
      source/frontend/carla_backend.py
  5. +5
    -1
      source/frontend/carla_host.py

+ 6
- 1
source/backend/CarlaBackend.h View File

@@ -1258,7 +1258,12 @@ typedef enum {
/*!
* Hide-optional-gui message.
*/
NSM_CALLBACK_HIDE_OPTIONAL_GUI = 7
NSM_CALLBACK_HIDE_OPTIONAL_GUI = 7,

/*!
* Set client name id message.
*/
NSM_CALLBACK_SET_CLIENT_NAME_ID = 8

} NsmCallbackOpcode;



+ 9
- 0
source/backend/CarlaStandaloneNSM.cpp View File

@@ -179,6 +179,9 @@ public:
lo_send_from(fReplyAddress, fServer, LO_TT_IMMEDIATE, "/nsm/client/gui_is_hidden", "");
}
break;

case CB::NSM_CALLBACK_SET_CLIENT_NAME_ID:
break;
}
}

@@ -284,6 +287,12 @@ protected:
if (gStandalone.engineCallback != nullptr)
{
fReadyActionOpen = false;
gStandalone.engineCallback(gStandalone.engineCallbackPtr,
CB::ENGINE_CALLBACK_NSM,
0,
CB::NSM_CALLBACK_SET_CLIENT_NAME_ID,
0, 0, 0.0f,
clientNameId);
gStandalone.engineCallback(gStandalone.engineCallbackPtr,
CB::ENGINE_CALLBACK_NSM,
0,


+ 1
- 11
source/backend/engine/CarlaEngineJack.cpp View File

@@ -1456,17 +1456,7 @@ public:

if (fClient == nullptr && clientName != nullptr)
{
#ifndef BUILD_BRIDGE
if (pData->options.processMode == ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS && fClientNamePrefix.isNotEmpty())
{
truncatedClientName = fClientNamePrefix;
truncatedClientName.truncate(truncatedClientName.rfind("."));
}
else
#endif
{
truncatedClientName = clientName;
}
truncatedClientName = clientName;
truncatedClientName.truncate(getMaxClientNameSize());
}



+ 3
- 0
source/frontend/carla_backend.py View File

@@ -897,6 +897,9 @@ NSM_CALLBACK_SHOW_OPTIONAL_GUI = 6
# Hide-optional-gui message.
NSM_CALLBACK_HIDE_OPTIONAL_GUI = 7

# Set client name id message.
NSM_CALLBACK_SET_CLIENT_NAME_ID = 8

# ---------------------------------------------------------------------------------------------------------------------
# Engine Option
# Engine options.


+ 5
- 1
source/frontend/carla_host.py View File

@@ -2490,7 +2490,6 @@ class HostWindow(QMainWindow):

# Open
elif opcode == NSM_CALLBACK_OPEN:
self.fClientName = os.path.basename(valueStr)
self.fProjectFilename = QFileInfo(valueStr+".carxp").absoluteFilePath()
self.setProperWindowTitle()

@@ -2514,6 +2513,11 @@ class HostWindow(QMainWindow):
elif opcode == NSM_CALLBACK_HIDE_OPTIONAL_GUI:
self.hideForNSM()

# Set client name
elif opcode == NSM_CALLBACK_SET_CLIENT_NAME_ID:
self.fClientName = valueStr
return

self.host.nsm_ready(opcode)

# --------------------------------------------------------------------------------------------------------


Loading…
Cancel
Save