2 # -*- coding: utf-8 -*-
4 # --------------------------------------------------------------------------------------------------------
6 from carla_backend
import *
7 from signal
import signal
, SIGINT
, SIGTERM
11 # --------------------------------------------------------------------------------------------------------
13 class CarlaObject(object):
18 gCarla
= CarlaObject()
21 def signalHandler(sig
, frame
):
22 if sig
in (SIGINT
, SIGTERM
):
25 # --------------------------------------------------------------------------------------------------------
27 binaryDir
= "/home/falktx/Personal/GIT-mine/falkTX/Carla/bin"
28 host
= CarlaHostDLL("/home/falktx/Personal/GIT-mine/falkTX/Carla/bin/libcarla_standalone2.so", True)
29 host
.set_engine_option(ENGINE_OPTION_PATH_BINARIES
, 0, binaryDir
)
30 host
.set_engine_option(ENGINE_OPTION_PROCESS_MODE
, 2, "")
31 host
.set_engine_option(ENGINE_OPTION_TRANSPORT_MODE
, 0, "")
33 if not host
.engine_init("PulseAudio", "Carla-Plugin-JACK"):
34 print("Engine failed to initialize, possible reasons:\n%s" % host
.get_last_error())
37 fname
= "pulseaudio --high-priority --realtime --exit-idle-time=-1 --file=/usr/share/cadence/pulse2jack/play.pa -n"
40 fname
= "/usr/bin/patchage"
43 fname
= "/usr/bin/carla"
46 if not host
.add_plugin(BINARY_NATIVE
, PLUGIN_JACK
, fname
, "", label
, 0, None, 0):
47 print("Failed to load plugin, possible reasons:\n%s" % host
.get_last_error())
51 signal(SIGINT
, signalHandler
)
52 signal(SIGTERM
, signalHandler
)
54 while host
.is_engine_running() and not gCarla
.term
:
59 print("Engine closed abruptely")
61 if not host
.engine_close():
62 print("Engine failed to close, possible reasons:\n%s" % host
.get_last_error())
65 # --------------------------------------------------------------------------------------------------------