From 1df3888c519f6d05fd90a4a9986c6b422a257b42 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 22 Aug 2018 12:58:47 +0200 Subject: [PATCH] Fix carla-plugin-patchbay detection under windows --- data/windows/build-win.sh | 1 + data/windows/pack-win.sh | 5 +++++ source/native-plugins/resources/carla-plugin | 18 ++++++++++-------- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/data/windows/build-win.sh b/data/windows/build-win.sh index a11571049..bf4885edb 100755 --- a/data/windows/build-win.sh +++ b/data/windows/build-win.sh @@ -66,6 +66,7 @@ if [ x"${ARCH}" != x"32" ]; then fi export WINEARCH=win${ARCH} +export WINEDEBUG=-all export WINEPREFIX=~/.winepy3_x${ARCH} export PYTHON_EXE="wine C:\\\\Python34\\\\python.exe" diff --git a/data/windows/pack-win.sh b/data/windows/pack-win.sh index b7b59d5e2..e0ad8d01d 100755 --- a/data/windows/pack-win.sh +++ b/data/windows/pack-win.sh @@ -59,6 +59,7 @@ if [ x"${ARCH}" != x"32" ]; then fi export WINEARCH=win${ARCH} +export WINEDEBUG=-all export WINEPREFIX=~/.winepy3_x${ARCH} export PYTHON_EXE="wine C:\\\\Python34\\\\python.exe" @@ -115,6 +116,10 @@ cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Widgets.dll Carl cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5OpenGL.dll Carla/resources/ cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Svg.dll Carla/resources/ +if [ x"${CARLA_DEV}" != x"" ]; then + exit 0 +fi + # Build unzipfx make -C unzipfx-carla -f Makefile.win32 clean make -C unzipfx-carla -f Makefile.win32 ${MAKE_ARGS} diff --git a/source/native-plugins/resources/carla-plugin b/source/native-plugins/resources/carla-plugin index 11bf70016..096f7ddfe 100755 --- a/source/native-plugins/resources/carla-plugin +++ b/source/native-plugins/resources/carla-plugin @@ -83,9 +83,9 @@ class PluginHost(CarlaHostQtPlugin): # Main Window class CarlaMiniW(ExternalUI, HostWindow): - def __init__(self, host, parent=None): + def __init__(self, host, isPatchbay, parent=None): ExternalUI.__init__(self) - HostWindow.__init__(self, host, sys.argv[0].lower().endswith("/carla-plugin-patchbay"), parent) + HostWindow.__init__(self, host, isPatchbay, parent) self.host = host if False: @@ -485,8 +485,8 @@ else: # Embed plugin UI class CarlaEmbedW(QEmbedWidget): - def __init__(self, host, winId): - QEmbedWidget.__init__(self, winId) + def __init__(self, host, winId, isPatchbay): + QEmbedWidget.__init__(self, winId, isPatchbay) self.host = host self.fWinId = winId @@ -498,7 +498,7 @@ class CarlaEmbedW(QEmbedWidget): self.fLayout.setSpacing(0) self.fWidget.setLayout(self.fLayout) - self.gui = CarlaMiniW(host, self.fWidget) + self.gui = CarlaMiniW(host, isPatchbay, self.fWidget) self.gui.hide() self.gui.ui.act_file_quit.setEnabled(False) @@ -610,8 +610,10 @@ if __name__ == '__main__': # ------------------------------------------------------------- # Init host backend + isPatchbay = sys.argv[0].rsplit(os.path.sep)[-1].lower().replace(".exe","") == "carla-plugin-patchbay" + 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.processMode = ENGINE_PROCESS_MODE_PATCHBAY if isPatchbay else ENGINE_PROCESS_MODE_CONTINUOUS_RACK host.processModeForced = True host.nextProcessMode = host.processMode loadHostSettings(host) @@ -627,9 +629,9 @@ if __name__ == '__main__': gCarla.utils.setenv("CARLA_PLUGIN_EMBED_WINID", "0") if LINUX and winId != 0: - gui = CarlaEmbedW(host, winId) + gui = CarlaEmbedW(host, winId, isPatchbay) else: - gui = CarlaMiniW(host) + gui = CarlaMiniW(host, isPatchbay) # ------------------------------------------------------------- # App-Loop