From 0d7861c926437c831f5ac36932974fdb0c146fd6 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 5 Apr 2015 11:08:17 +0200 Subject: [PATCH] Cleanup --- source/carla_database.py | 16 ++++++++++------ source/carla_host.py | 13 +++---------- source/carla_shared.py | 3 +++ source/native-plugins/resources/carla-plugin | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/carla_database.py b/source/carla_database.py index aaed76704..e650b0549 100755 --- a/source/carla_database.py +++ b/source/carla_database.py @@ -45,12 +45,16 @@ from carla_shared import * # ------------------------------------------------------------------------------------------------------------ # Try Import LADSPA-RDF -try: - import ladspa_rdf - import json - haveLRDF = True -except: - qWarning("LRDF Support not available (LADSPA-RDF will be disabled)") +if not CXFREEZE: + try: + import ladspa_rdf + import json + haveLRDF = True + except: + qWarning("LRDF Support not available (LADSPA-RDF will be disabled)") + haveLRDF = False +else: + qWarning("LRDF Support disabled for static build (LADSPA-RDF will be disabled)") haveLRDF = False # ------------------------------------------------------------------------------------------------------------ diff --git a/source/carla_host.py b/source/carla_host.py index 34ce3db32..dcd97f3ea 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -2106,14 +2106,7 @@ def fileCallback(ptr, action, isDir, title, filter): # ------------------------------------------------------------------------------------------------------------ # Init host -def initHost(initName, libPrefixOrPluginClass, isControl, isPlugin, failError): - if isPlugin: - PluginClass = libPrefixOrPluginClass - libPrefix = None - else: - PluginClass = None - libPrefix = libPrefixOrPluginClass - +def initHost(initName, libPrefix, isControl, isPlugin, failError, HostClass = None): pathBinaries, pathResources = getPaths(libPrefix) # -------------------------------------------------------------------------------------------------------- @@ -2146,10 +2139,10 @@ def initHost(initName, libPrefixOrPluginClass, isControl, isPlugin, failError): if failError: # no try - host = PluginClass() if isPlugin else CarlaHostQtDLL(os.path.join(pathBinaries, libname)) + host = HostClass() if HostClass is not None else CarlaHostQtDLL(os.path.join(pathBinaries, libname)) else: try: - host = PluginClass() if isPlugin else CarlaHostQtDLL(os.path.join(pathBinaries, libname)) + host = HostClass() if HostClass is not None else CarlaHostQtDLL(os.path.join(pathBinaries, libname)) except: host = CarlaHostQtNull() diff --git a/source/carla_shared.py b/source/carla_shared.py index 527f2f6be..b156210ec 100644 --- a/source/carla_shared.py +++ b/source/carla_shared.py @@ -496,6 +496,9 @@ if not CWD: # make it work with cxfreeze if os.path.isfile(CWD): CWD = os.path.dirname(CWD) + CXFREEZE = True +else: + CXFREEZE = False # ------------------------------------------------------------------------------------------------------------ # Set DLL_EXTENSION diff --git a/source/native-plugins/resources/carla-plugin b/source/native-plugins/resources/carla-plugin index 89110624a..99b5fe66d 100755 --- a/source/native-plugins/resources/carla-plugin +++ b/source/native-plugins/resources/carla-plugin @@ -506,7 +506,7 @@ if __name__ == '__main__': # ------------------------------------------------------------- # Init host backend - host = initHost("Carla-Plugin", PluginHost, False, True, True) + host = initHost("Carla-Plugin", None, False, True, True, PluginHost) host.processMode = ENGINE_PROCESS_MODE_PATCHBAY if sys.argv[0].lower().endswith("/carla-plugin-patchbay") else ENGINE_PROCESS_MODE_CONTINUOUS_RACK host.processModeForced = True host.nextProcessMode = host.processMode