|
|
@@ -21,8 +21,6 @@ |
|
|
|
|
|
|
|
import os |
|
|
|
import sys |
|
|
|
from signal import signal, SIGINT, SIGTERM |
|
|
|
from subprocess import Popen |
|
|
|
|
|
|
|
# -------------------------------------------------------------------------------------------------------- |
|
|
|
# Setup |
|
|
@@ -199,30 +197,9 @@ if FILENAME and not os.path.exists(FILENAME): |
|
|
|
print("Requested filename does not exist") |
|
|
|
sys.exit(1) |
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------------------------------------ |
|
|
|
# Signal handler |
|
|
|
|
|
|
|
global gProc |
|
|
|
gProc = None |
|
|
|
|
|
|
|
def signalHandler(sig, frame): |
|
|
|
global gProc |
|
|
|
|
|
|
|
if gProc is None: |
|
|
|
return |
|
|
|
|
|
|
|
if sig in (SIGINT, SIGTERM): |
|
|
|
gProc.kill() |
|
|
|
gProc = None |
|
|
|
|
|
|
|
signal(SIGINT, signalHandler) |
|
|
|
signal(SIGTERM, signalHandler) |
|
|
|
|
|
|
|
# -------------------------------------------------------------------------------------------------------- |
|
|
|
# Setup environment |
|
|
|
|
|
|
|
#CARLA_CLIENT_NAME = os.getenv("CARLA_CLIENT_NAME", "(none)") |
|
|
|
|
|
|
|
#os.environ["ENGINE_OPTION_UIS_ALWAYS_ON_TOP"] = "false" |
|
|
|
#os.environ["ENGINE_OPTION_MAX_PARAMETERS"] = "200" |
|
|
|
#os.environ["ENGINE_OPTION_UI_BRIDGES_TIMEOUT"] = "3000" |
|
|
@@ -250,6 +227,18 @@ if SFZ_PATH is not None: os.environ["ENGINE_OPTION_PLUGIN_PATH_SFZ"] = SFZ |
|
|
|
os.environ["ENGINE_OPTION_PATH_BINARIES"] = CARLA_LIBDIR |
|
|
|
os.environ["ENGINE_OPTION_PATH_RESOURCES"] = CARLA_RESDIR |
|
|
|
|
|
|
|
# -------------------------------------------------------------------------------------------------------- |
|
|
|
|
|
|
|
CARLA_CLIENT_NAME = os.getenv("CARLA_CLIENT_NAME") |
|
|
|
LADISH_APP_NAME = os.getenv("LADISH_APP_NAME") |
|
|
|
|
|
|
|
if CARLA_CLIENT_NAME is not None: |
|
|
|
os.environ["CARLA_CLIENT_NAME"] = CARLA_CLIENT_NAME |
|
|
|
elif CARLA_CLIENT_NAME is not None: |
|
|
|
os.environ["CARLA_CLIENT_NAME"] = LADISH_APP_NAME |
|
|
|
else: |
|
|
|
os.environ["CARLA_CLIENT_NAME"] = "(none)" |
|
|
|
|
|
|
|
# -------------------------------------------------------------------------------------------------------- |
|
|
|
# Exec |
|
|
|
|
|
|
@@ -265,8 +254,6 @@ command.append(LABEL or "(none)") |
|
|
|
command.append(str(UNIQUEID)) |
|
|
|
|
|
|
|
print(command) |
|
|
|
|
|
|
|
gProc = Popen(command) |
|
|
|
gProc.wait() |
|
|
|
os.execvp(command[0], command) |
|
|
|
|
|
|
|
# -------------------------------------------------------------------------------------------------------- |