diff --git a/data/carla b/data/carla index 2a6391664..08df9a7e5 100755 --- a/data/carla +++ b/data/carla @@ -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" "$@" diff --git a/data/carla-control b/data/carla-control index 43efc52ea..369ddf06a 100755 --- a/data/carla-control +++ b/data/carla-control @@ -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" "$@" diff --git a/source/backend/CarlaStandalone.hpp b/source/backend/CarlaStandalone.hpp index 5f04d2fb9..cafeadb76 100644 --- a/source/backend/CarlaStandalone.hpp +++ b/source/backend/CarlaStandalone.hpp @@ -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. diff --git a/source/backend/standalone/CarlaStandalone.cpp b/source/backend/standalone/CarlaStandalone.cpp index 76a0dec7e..03f4a2dc8 100644 --- a/source/backend/standalone/CarlaStandalone.cpp +++ b/source/backend/standalone/CarlaStandalone.cpp @@ -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() diff --git a/source/carla.py b/source/carla.py index addc586f4..ab49c1438 100755 --- a/source/carla.py +++ b/source/carla.py @@ -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): diff --git a/source/carla_backend.py b/source/carla_backend.py index 842e13296..b2861ad9a 100644 --- a/source/carla_backend.py +++ b/source/carla_backend.py @@ -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()