Browse Source

Pass appName to NSM announce, fix local usage

tags/1.9.4
falkTX 11 years ago
parent
commit
8b7f98aa75
6 changed files with 21 additions and 15 deletions
  1. +1
    -1
      data/carla
  2. +1
    -1
      data/carla-control
  3. +1
    -1
      source/backend/CarlaStandalone.hpp
  4. +4
    -4
      source/backend/standalone/CarlaStandalone.cpp
  5. +12
    -6
      source/carla.py
  6. +2
    -2
      source/carla_backend.py

+ 1
- 1
data/carla View File

@@ -8,4 +8,4 @@ fi

INSTALL_PREFIX="X-PREFIX-X"
export PATH="$INSTALL_PREFIX"/lib/carla:$PATH
exec $PYTHON $INSTALL_PREFIX/share/carla/carla.py --with-libprefix="$INSTALL_PREFIX" "$@"
exec $PYTHON $INSTALL_PREFIX/share/carla/carla.py --with-appname="$0" --with-libprefix="$INSTALL_PREFIX" "$@"

+ 1
- 1
data/carla-control View File

@@ -8,4 +8,4 @@ fi

INSTALL_PREFIX="X-PREFIX-X"
export PATH="$INSTALL_PREFIX"/lib/carla:$PATH
exec $PYTHON $INSTALL_PREFIX/share/carla/carla_control.py --with-libprefix="$INSTALL_PREFIX" "$@"
exec $PYTHON $INSTALL_PREFIX/share/carla/carla_control.py --with-appname="$0" --with-libprefix="$INSTALL_PREFIX" "$@"

+ 1
- 1
source/backend/CarlaStandalone.hpp View File

@@ -681,7 +681,7 @@ CARLA_EXPORT const char* carla_get_host_osc_url();
/*!
* Send NSM announce message.
*/
CARLA_EXPORT void carla_nsm_announce(const char* url, int pid);
CARLA_EXPORT void carla_nsm_announce(const char* url, const char* appName, int pid);

/*!
* Reply to NSM open message.


+ 4
- 4
source/backend/standalone/CarlaStandalone.cpp View File

@@ -2092,7 +2092,7 @@ public:
}
}

void announce(const char* const url, const int pid)
void announce(const char* const url, const char* appName, const int pid)
{
lo_address const addr = lo_address_new_from_url(url);

@@ -2114,7 +2114,7 @@ public:
}

lo_send_from(addr, lo_server_thread_get_server(fServerThread), LO_TT_IMMEDIATE, "/nsm/server/announce", "sssiii",
"Carla", ":switch:", "carla", NSM_API_VERSION_MAJOR, NSM_API_VERSION_MINOR, pid);
"Carla", ":switch:", appName, NSM_API_VERSION_MAJOR, NSM_API_VERSION_MINOR, pid);

lo_address_free(addr);
}
@@ -2263,9 +2263,9 @@ private:

static CarlaNSM gCarlaNSM;

void carla_nsm_announce(const char* url, int pid)
void carla_nsm_announce(const char* url, const char* appName, int pid)
{
gCarlaNSM.announce(url, pid);
gCarlaNSM.announce(url, appName, pid);
}

void carla_nsm_reply_open()


+ 12
- 6
source/carla.py View File

@@ -73,6 +73,13 @@ CARLA_DEFAULT_DISABLE_CHECKS = False
CANVAS_ANTIALIASING_SMALL = 1
CANVAS_EYECANDY_SMALL = 1

# ------------------------------------------------------------------------------------------------------------
# Global Variables

appName = sys.argv[0]
libPrefix = None
projectFilename = None

# ------------------------------------------------------------------------------------------------------------
# Log Syntax Highlighter

@@ -743,7 +750,7 @@ class CarlaMainW(QMainWindow):
NSM_URL = os.getenv("NSM_URL")

if NSM_URL:
Carla.host.nsm_announce(NSM_URL, os.getpid())
Carla.host.nsm_announce(NSM_URL, appName, os.getpid())
else:
QTimer.singleShot(0, self, SLOT("slot_engineStart()"))

@@ -1201,7 +1208,6 @@ class CarlaMainW(QMainWindow):
self.ui.act_file_open.setEnabled(check)
self.ui.act_engine_start.setEnabled(not check)
self.ui.act_engine_stop.setEnabled(check)
self.ui.act_engine_configure.setEnabled(not check)

if check:
self.fInfoText = "Engine running | SampleRate: %g | BufferSize: %i" % (self.fSampleRate, self.fBufferSize)
@@ -1964,14 +1970,14 @@ if __name__ == '__main__':
app.setOrganizationName("falkTX")
app.setWindowIcon(QIcon(":/scalable/carla.svg"))

libPrefix = None
projectFilename = None

for i in range(len(app.arguments())):
if i == 0: continue
argument = app.arguments()[i]

if argument.startswith("--with-libprefix="):
if argument.startswith("--with-appname="):
appName = argument.replace("--with-appname=", "")

elif argument.startswith("--with-libprefix="):
libPrefix = argument.replace("--with-libprefix=", "")

elif os.path.exists(argument):


+ 2
- 2
source/carla_backend.py View File

@@ -866,8 +866,8 @@ class Host(object):
def get_sample_rate(self):
return self.lib.carla_get_sample_rate()

def nsm_announce(self, url, pid):
self.lib.carla_nsm_announce(url.encode("utf-8"), pid)
def nsm_announce(self, url, appName, pid):
self.lib.carla_nsm_announce(url.encode("utf-8"), appName.encode("utf-8"), pid)

def nsm_reply_open(self):
self.lib.carla_nsm_reply_open()


Loading…
Cancel
Save