From b783e0c4ae79a8b60383526a563403f153e46374 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 2 Sep 2014 02:31:27 +0100 Subject: [PATCH] Misc --- source/carla_backend.py | 4 ++++ source/carla_settings.py | 19 ++++++++++++++----- source/carla_shared.py | 13 +------------ 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/source/carla_backend.py b/source/carla_backend.py index 7eed4e11c..1fbd3bd6d 100644 --- a/source/carla_backend.py +++ b/source/carla_backend.py @@ -1240,6 +1240,7 @@ else: class CarlaHostMeta(object): #class CarlaHostMeta(metaclass=ABCMeta): def __init__(self): + # info about this host object self.isControl = False self.isPlugin = False @@ -2169,6 +2170,9 @@ class CarlaHostDLL(CarlaHostMeta): def __init__(self, libName): CarlaHostMeta.__init__(self) + # info about this host object + self.isPlugin = False + self.lib = cdll.LoadLibrary(libName) self.lib.carla_get_complete_license_text.argtypes = None diff --git a/source/carla_settings.py b/source/carla_settings.py index 2d660143c..d3034877a 100755 --- a/source/carla_settings.py +++ b/source/carla_settings.py @@ -207,6 +207,7 @@ class CarlaSettingsW(QDialog): if False: # kdevelop likes this :) host = CarlaHostMeta() + self.host = host self.ui.lw_page.setFixedWidth(48 + 6 + 6 + QFontMetrics(self.ui.lw_page.font()).width("88888888")) @@ -246,7 +247,7 @@ class CarlaSettingsW(QDialog): if host.isPlugin: self.ui.cb_engine_audio_driver.setCurrentIndex(0) self.ui.cb_engine_audio_driver.setEnabled(False) - self.ui.cb_engine_process_mode_other.setCurrentIndex(gCarla.processMode-self.PROCESS_MODE_NON_JACK_PADDING) + self.ui.cb_engine_process_mode_other.setCurrentIndex(host.processMode-self.PROCESS_MODE_NON_JACK_PADDING) self.ui.cb_engine_process_mode_other.setEnabled(False) self.ui.sw_engine_process_mode.setCurrentIndex(1) self.ui.tb_engine_driver_config.setEnabled(False) @@ -778,10 +779,18 @@ if __name__ == '__main__': from carla_app import CarlaApplication from carla_host import initHost - app = CarlaApplication() - host = initHost("Settings", None, False) + app = CarlaApplication() - gui = CarlaSettingsW(None, host, True, True, True) - gui.show() + host1 = initHost("Settings", None, False, False, True) + host2 = initHost("Settings", None, False, True, True) + + gui1 = CarlaSettingsW(None, host1, True, True, True) + gui2 = CarlaSettingsW(None, host2, True, True, True) + + gui1.setWindowTitle("Settings - DLL") + gui2.setWindowTitle("Settings - Plugin") + + gui1.show() + gui2.show() sys.exit(app.exec_()) diff --git a/source/carla_shared.py b/source/carla_shared.py index 3069120fb..75c7129c0 100644 --- a/source/carla_shared.py +++ b/source/carla_shared.py @@ -484,22 +484,11 @@ del DEFAULT_SFZ_PATH class CarlaObject(object): __slots__ = [ - # Host Window - 'gui', - # current buffer size - 'bufferSize', - # current sample rate - 'sampleRate', - # wherever to use external patchbay mode - 'externalPatchbay', - # wherever to use custom skins - 'useCustomSkins' + 'gui' # Host Window ] gCarla = CarlaObject() gCarla.gui = None -gCarla.bufferSize = 0 -gCarla.sampleRate = 0.0 # ------------------------------------------------------------------------------------------------------------ # Set CWD