From 3c6c972a8c210c2b2e28c78af75298854de41c0e Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 15 Apr 2018 22:16:01 +0200 Subject: [PATCH 1/6] Start a function to get build-time features --- source/backend/CarlaUtils.cpp | 7 +++++++ source/backend/CarlaUtils.h | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/source/backend/CarlaUtils.cpp b/source/backend/CarlaUtils.cpp index 1168e6015..702a2e4b9 100644 --- a/source/backend/CarlaUtils.cpp +++ b/source/backend/CarlaUtils.cpp @@ -536,6 +536,13 @@ const char* carla_get_supported_file_extensions() return retText; } +const char* const* carla_get_supported_features() +{ + carla_debug("carla_get_supported_features()"); + + return nullptr; +} + // ------------------------------------------------------------------------------------------------------------------- void carla_fflush(bool err) diff --git a/source/backend/CarlaUtils.h b/source/backend/CarlaUtils.h index 0ce4f613f..2f8741eaf 100644 --- a/source/backend/CarlaUtils.h +++ b/source/backend/CarlaUtils.h @@ -1,6 +1,6 @@ /* * Carla Plugin Host - * Copyright (C) 2011-2014 Filipe Coelho + * Copyright (C) 2011-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -138,6 +138,11 @@ CARLA_EXPORT const char* carla_get_complete_license_text(); */ CARLA_EXPORT const char* carla_get_supported_file_extensions(); +/*! + * Get the list of supported features in the current Carla build. + */ +CARLA_EXPORT const char* const* carla_get_supported_features(); + /*! * Get how many cached plugins are available. * Internal, LV2 and AU plugin formats are cached and need to be discovered via this function. From 456b13efaa147b41771e4976a235d5b34a7d052c Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 15 Apr 2018 22:16:15 +0200 Subject: [PATCH 2/6] Transport controls are now considered stable --- resources/ui/carla_settings.ui | 7 ----- source/backend/engine/CarlaEngineInternal.cpp | 2 +- source/backend/engine/CarlaEngineInternal.hpp | 2 +- source/carla_host.py | 30 +++++-------------- source/carla_settings.py | 6 ---- source/carla_shared.py | 2 -- 6 files changed, 10 insertions(+), 39 deletions(-) diff --git a/resources/ui/carla_settings.ui b/resources/ui/carla_settings.ui index 091fd58fc..a10f298eb 100644 --- a/resources/ui/carla_settings.ui +++ b/resources/ui/carla_settings.ui @@ -1793,13 +1793,6 @@ Main - - - - Enable transport controls - - - diff --git a/source/backend/engine/CarlaEngineInternal.cpp b/source/backend/engine/CarlaEngineInternal.cpp index 0fe6e33dd..270aab500 100644 --- a/source/backend/engine/CarlaEngineInternal.cpp +++ b/source/backend/engine/CarlaEngineInternal.cpp @@ -1,6 +1,6 @@ /* * Carla Plugin Host - * Copyright (C) 2011-2017 Filipe Coelho + * Copyright (C) 2011-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff --git a/source/backend/engine/CarlaEngineInternal.hpp b/source/backend/engine/CarlaEngineInternal.hpp index e821b9905..32c6d1a1a 100644 --- a/source/backend/engine/CarlaEngineInternal.hpp +++ b/source/backend/engine/CarlaEngineInternal.hpp @@ -1,6 +1,6 @@ /* * Carla Plugin Host - * Copyright (C) 2011-2017 Filipe Coelho + * Copyright (C) 2011-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff --git a/source/carla_host.py b/source/carla_host.py index a7bb8ab3a..739d1bd5d 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -1530,29 +1530,15 @@ class HostWindow(QMainWindow): self.ui.act_add_jack.setVisible(False) if not (self.host.isControl or self.host.isPlugin): - if self.host.experimental: - if settings.value(CARLA_KEY_EXPERIMENTAL_TRANSPORT, CARLA_DEFAULT_EXPERIMENTAL_TRANSPORT, type=bool): - if self.ui.cb_transport_jack.isChecked(): - transportMode = ENGINE_TRANSPORT_MODE_JACK - else: - transportMode = ENGINE_TRANSPORT_MODE_INTERNAL - transportExtra = ":link:" if self.ui.cb_transport_link.isChecked() else "" - else: - # Stop transport if becoming disabled - if self.ui.w_transport.isEnabled() and self.host.is_engine_running(): - self.host.transport_pause() - self.host.transport_relocate(0) - self.host.transport_pause() - - transportMode = ENGINE_TRANSPORT_MODE_DISABLED - transportExtra = "" - - self.ui.w_transport.setEnabled(transportMode != ENGINE_TRANSPORT_MODE_DISABLED) - self.host.transportMode = transportMode - self.host.set_engine_option(ENGINE_OPTION_TRANSPORT_MODE, transportMode, transportExtra) - + if self.ui.cb_transport_jack.isChecked(): + transportMode = ENGINE_TRANSPORT_MODE_JACK else: - self.ui.w_transport.setEnabled(False) + transportMode = ENGINE_TRANSPORT_MODE_INTERNAL + transportExtra = ":link:" if self.ui.cb_transport_link.isChecked() else "" + + self.ui.w_transport.setEnabled(transportMode != ENGINE_TRANSPORT_MODE_DISABLED) + self.host.transportMode = transportMode + self.host.set_engine_option(ENGINE_OPTION_TRANSPORT_MODE, transportMode, transportExtra) self.fMiniCanvasUpdateTimeout = 1000 if self.fSavedSettings[CARLA_KEY_CANVAS_FANCY_EYE_CANDY] else 0 diff --git a/source/carla_settings.py b/source/carla_settings.py index 8c4a74c3c..9e7e4a8f4 100755 --- a/source/carla_settings.py +++ b/source/carla_settings.py @@ -517,10 +517,6 @@ class CarlaSettingsW(QDialog): # ---------------------------------------------------------------------------------------------------- # Experimental - self.ui.ch_exp_transport.setChecked(settings.value(CARLA_KEY_EXPERIMENTAL_TRANSPORT, - CARLA_DEFAULT_EXPERIMENTAL_TRANSPORT, - type=bool)) - self.ui.ch_exp_jack_apps.setChecked(settings.value(CARLA_KEY_EXPERIMENTAL_JACK_APPS, CARLA_DEFAULT_EXPERIMENTAL_JACK_APPS, type=bool)) @@ -692,7 +688,6 @@ class CarlaSettingsW(QDialog): # ---------------------------------------------------------------------------------------------------- # Experimental - settings.setValue(CARLA_KEY_EXPERIMENTAL_TRANSPORT, self.ui.ch_exp_transport.isChecked()) settings.setValue(CARLA_KEY_EXPERIMENTAL_JACK_APPS, self.ui.ch_exp_jack_apps.isChecked()) settings.setValue(CARLA_KEY_EXPERIMENTAL_LOAD_LIB_GLOBAL, self.ui.ch_exp_load_lib_global.isChecked()) settings.setValue(CARLA_KEY_EXPERIMENTAL_PREVENT_BAD_BEHAVIOUR, self.ui.ch_exp_prevent_bad_behaviour.isChecked()) @@ -846,7 +841,6 @@ class CarlaSettingsW(QDialog): self.ui.cb_canvas_render_hq_aa.setChecked(CARLA_DEFAULT_CANVAS_HQ_ANTIALIASING and self.ui.cb_canvas_render_hq_aa.isEnabled()) self.ui.ch_engine_force_stereo.setChecked(CARLA_DEFAULT_FORCE_STEREO) self.ui.ch_engine_prefer_plugin_bridges.setChecked(CARLA_DEFAULT_PREFER_PLUGIN_BRIDGES) - self.ui.ch_exp_transport.setChecked(CARLA_DEFAULT_EXPERIMENTAL_TRANSPORT) # -------------------------------------------------------------------------------------------------------- diff --git a/source/carla_shared.py b/source/carla_shared.py index 02483b84c..dd390632c 100644 --- a/source/carla_shared.py +++ b/source/carla_shared.py @@ -233,7 +233,6 @@ CARLA_KEY_WINE_RT_PRIO_ENABLED = "Wine/RtPrioEnabled" # bool CARLA_KEY_WINE_BASE_RT_PRIO = "Wine/BaseRtPrio" # int CARLA_KEY_WINE_SERVER_RT_PRIO = "Wine/ServerRtPrio" # int -CARLA_KEY_EXPERIMENTAL_TRANSPORT = "Experimental/Transport" # bool CARLA_KEY_EXPERIMENTAL_PLUGIN_BRIDGES = "Experimental/PluginBridges" # bool CARLA_KEY_EXPERIMENTAL_WINE_BRIDGES = "Experimental/WineBridges" # bool CARLA_KEY_EXPERIMENTAL_JACK_APPS = "Experimental/JackApplications" # bool @@ -306,7 +305,6 @@ CARLA_DEFAULT_WINE_BASE_RT_PRIO = 15 CARLA_DEFAULT_WINE_SERVER_RT_PRIO = 10 # Experimental -CARLA_DEFAULT_EXPERIMENTAL_TRANSPORT = False CARLA_DEFAULT_EXPERIMENTAL_PLUGIN_BRIDGES = False CARLA_DEFAULT_EXPERIMENTAL_WINE_BRIDGES = False CARLA_DEFAULT_EXPERIMENTAL_JACK_APPS = False From 1c80870105e45cf96c11b75591bf4d5348f5e70a Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 15 Apr 2018 22:28:48 +0200 Subject: [PATCH 3/6] Show transport text as enable in plugin mode, and hide controls --- source/carla_host.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/source/carla_host.py b/source/carla_host.py index 739d1bd5d..e6a5d2799 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -306,10 +306,16 @@ class HostWindow(QMainWindow): self.ui.b_transport_stop.setEnabled(False) self.ui.b_transport_backwards.setEnabled(False) self.ui.b_transport_forwards.setEnabled(False) + self.ui.group_transport_controls.setEnabled(False) + self.ui.group_transport_controls.setVisible(False) self.ui.cb_transport_link.setEnabled(False) + self.ui.cb_transport_link.setVisible(False) + self.ui.cb_transport_jack.setEnabled(False) + self.ui.cb_transport_jack.setVisible(False) self.ui.dsb_transport_bpm.setEnabled(False) + self.ui.dsb_transport_bpm.setReadOnly(True) - if MACOS: + if MACOS: # FIXME self.ui.cb_transport_link.setEnabled(False) self.ui.w_transport.setEnabled(False) @@ -771,6 +777,7 @@ class HostWindow(QMainWindow): self.ui.menu_PluginMacros.setEnabled(True) self.ui.menu_Canvas.setEnabled(True) + self.ui.w_transport.setEnabled(True) self.ui.act_canvas_show_internal.blockSignals(True) self.ui.act_canvas_show_external.blockSignals(True) @@ -794,7 +801,7 @@ class HostWindow(QMainWindow): self.ui.act_file_save.setEnabled(canSave) self.ui.act_engine_start.setEnabled(False) self.ui.act_engine_stop.setEnabled(True) - self.ui.w_transport.setEnabled(transportMode != ENGINE_TRANSPORT_MODE_DISABLED) + self.enableTransport(transportMode != ENGINE_TRANSPORT_MODE_DISABLED) if self.host.isPlugin or not self.fSessionManagerName: self.ui.act_file_open.setEnabled(True) @@ -817,12 +824,12 @@ class HostWindow(QMainWindow): self.ui.menu_PluginMacros.setEnabled(False) self.ui.menu_Canvas.setEnabled(False) + self.ui.w_transport.setEnabled(False) if not (self.host.isControl or self.host.isPlugin): self.ui.act_file_save.setEnabled(False) self.ui.act_engine_start.setEnabled(True) self.ui.act_engine_stop.setEnabled(False) - self.ui.w_transport.setEnabled(False) if self.host.isPlugin or not self.fSessionManagerName: self.ui.act_file_open.setEnabled(False) @@ -1536,7 +1543,7 @@ class HostWindow(QMainWindow): transportMode = ENGINE_TRANSPORT_MODE_INTERNAL transportExtra = ":link:" if self.ui.cb_transport_link.isChecked() else "" - self.ui.w_transport.setEnabled(transportMode != ENGINE_TRANSPORT_MODE_DISABLED) + self.enableTransport(transportMode != ENGINE_TRANSPORT_MODE_DISABLED) self.host.transportMode = transportMode self.host.set_engine_option(ENGINE_OPTION_TRANSPORT_MODE, transportMode, transportExtra) @@ -1548,6 +1555,10 @@ class HostWindow(QMainWindow): # -------------------------------------------------------------------------------------------------------- # Settings (helpers) + def enableTransport(self, enabled): + self.ui.group_transport_controls.setEnabled(enabled) + self.ui.group_transport_settings.setEnabled(enabled) + @pyqtSlot() def slot_restoreCanvasScrollbarValues(self): settings = QSettings() From 6625c4838a12bffd64ba6eb9e9cbcb8fc14e8672 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 15 Apr 2018 23:05:16 +0200 Subject: [PATCH 4/6] Fix up of supported file extensions --- source/backend/CarlaUtils.cpp | 69 +++++++++++++++++++-------- source/backend/CarlaUtils.h | 8 +--- source/backend/engine/CarlaEngine.cpp | 27 ++++++++++- source/carla_host.py | 4 +- source/carla_utils.py | 17 ++++--- source/widgets/racklistwidget.py | 11 +---- 6 files changed, 91 insertions(+), 45 deletions(-) diff --git a/source/backend/CarlaUtils.cpp b/source/backend/CarlaUtils.cpp index 702a2e4b9..83ef57cba 100644 --- a/source/backend/CarlaUtils.cpp +++ b/source/backend/CarlaUtils.cpp @@ -497,50 +497,77 @@ const char* carla_get_complete_license_text() return retText; } -const char* carla_get_supported_file_extensions() +const char* const* carla_get_supported_file_extensions() { carla_debug("carla_get_supported_file_extensions()"); - static CarlaString retText; - - if (retText.isEmpty()) - { - retText = + // NOTE: please keep in sync with CarlaEngine::loadFile!! + static const char* const extensions[] = { // Base types - "*.carxp;*.carxs" - // MIDI files - ";*.mid;*.midi" + "carxp", "carxs", + + // plugin files and resources #ifdef HAVE_FLUIDSYNTH - // fluidsynth (sf2) - ";*.sf2" + "sf2", #endif #ifdef HAVE_LINUXSAMPLER - // linuxsampler (gig and sfz) - ";*.gig;*.sfz" + "gig", "sfz", #endif #ifdef HAVE_ZYN_DEPS - // zynaddsubfx presets - ";*.xmz;*.xiz" + "xmz", "xiz", +#endif +#if defined(CARLA_OS_MAC) + "vst", +#else + "dll", + "so", #endif - ; // Audio files #ifdef HAVE_SNDFILE - retText += ";*.aiff;*.flac;*.oga;*.ogg;*.w64;*.wav"; + "aif", "aiff", "bwf", "flac", "oga", "ogg", "w64", "wav", #endif #ifdef HAVE_FFMPEG - retText += ";*.3g2;*.3gp;*.aac;*.ac3;*.amr;*.ape;*.mp2;*.mp3;*.mpc;*.wma"; + "3g2", "3gp", "aac", "ac3", "amr", "ape", "mp2", "mp3", "mpc", "wma", #endif - } - return retText; + // MIDI files + "mid", "midi", + + // terminator + nullptr + }; + + return extensions; } const char* const* carla_get_supported_features() { carla_debug("carla_get_supported_features()"); - return nullptr; + static const char* const features[] = { +#ifdef HAVE_FLUIDSYNTH + "sf2", +#endif +#ifdef HAVE_HYLIA + "link", +#endif +#ifdef HAVE_LIBLO + "osc", +#endif +#if defined(HAVE_LIBMAGIC) || defined(CARLA_OS_WIN) + "bridges", +#endif +#ifdef HAVE_LINUXSAMPLER + "gig", "sfz", +#endif +#ifdef HAVE_PYQT + "gui", +#endif + nullptr + }; + + return features; } // ------------------------------------------------------------------------------------------------------------------- diff --git a/source/backend/CarlaUtils.h b/source/backend/CarlaUtils.h index 2f8741eaf..0012647ef 100644 --- a/source/backend/CarlaUtils.h +++ b/source/backend/CarlaUtils.h @@ -130,13 +130,9 @@ typedef struct _CarlaCachedPluginInfo { CARLA_EXPORT const char* carla_get_complete_license_text(); /*! - * Get all the supported file extensions in carla_load_file(). - * Returned string uses this syntax: - * @code - * "*.ext1;*.ext2;*.ext3" - * @endcode + * Get the list of supported file extensions in carla_load_file(). */ -CARLA_EXPORT const char* carla_get_supported_file_extensions(); +CARLA_EXPORT const char* const* carla_get_supported_file_extensions(); /*! * Get the list of supported features in the current Carla build. diff --git a/source/backend/engine/CarlaEngine.cpp b/source/backend/engine/CarlaEngine.cpp index ee963ab48..f05069d10 100644 --- a/source/backend/engine/CarlaEngine.cpp +++ b/source/backend/engine/CarlaEngine.cpp @@ -1028,6 +1028,7 @@ bool CarlaEngine::loadFile(const char* const filename) const uint curPluginId(pData->nextPluginId < pData->curPluginCount ? pData->nextPluginId : pData->curPluginCount); // ------------------------------------------------------------------- + // NOTE: please keep in sync with carla_get_supported_file_extensions!! if (extension == "carxp" || extension == "carxs") return loadProject(filename); @@ -1045,7 +1046,31 @@ bool CarlaEngine::loadFile(const char* const filename) // ------------------------------------------------------------------- - if (extension == "aif" || extension == "aiff" || extension == "bwf" || extension == "flac" || extension == "ogg" || extension == "wav") + if ( +#ifdef HAVE_SNDFILE + extension == "aif" || + extension == "aiff" || + extension == "bwf" || + extension == "flac" || + extension == "oga" || + extension == "ogg" || + extension == "w64" || + extension == "wav" || +#endif +#ifdef HAVE_FFMPEG + extension == "3g2" || + extension == "3gp" || + extension == "aac" || + extension == "ac3" || + extension == "amr" || + extension == "ape" || + extension == "mp2" || + extension == "mp3" || + extension == "mpc" || + extension == "wma" || +#endif + false + ) { if (addPlugin(PLUGIN_INTERNAL, nullptr, baseName, "audiofile", 0, nullptr)) { diff --git a/source/carla_host.py b/source/carla_host.py index e6a5d2799..e7b7cb0f8 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -267,9 +267,11 @@ class HostWindow(QMainWindow): # ---------------------------------------------------------------------------------------------------- # Set up GUI (disk) + exts = gCarla.utils.get_supported_file_extensions() + self.fDirModel = QFileSystemModel(self) self.fDirModel.setRootPath(HOME) - self.fDirModel.setNameFilters(gCarla.utils.get_supported_file_extensions().split(";")) + self.fDirModel.setNameFilters(tuple(("*." + i) for i in exts)) self.ui.fileTreeView.setModel(self.fDirModel) self.ui.fileTreeView.setRootIndex(self.fDirModel.index(HOME)) diff --git a/source/carla_utils.py b/source/carla_utils.py index 9dd7a98a1..4412585da 100644 --- a/source/carla_utils.py +++ b/source/carla_utils.py @@ -165,7 +165,10 @@ class CarlaUtils(object): self.lib.carla_get_complete_license_text.restype = c_char_p self.lib.carla_get_supported_file_extensions.argtypes = None - self.lib.carla_get_supported_file_extensions.restype = c_char_p + self.lib.carla_get_supported_file_extensions.restype = POINTER(c_char_p) + + self.lib.carla_get_supported_features.argtypes = None + self.lib.carla_get_supported_features.restype = POINTER(c_char_p) self.lib.carla_get_cached_plugin_count.argtypes = [c_enum, c_char_p] self.lib.carla_get_cached_plugin_count.restype = c_uint @@ -262,13 +265,13 @@ class CarlaUtils(object): def get_complete_license_text(self): return charPtrToString(self.lib.carla_get_complete_license_text()) - # Get all the supported file extensions in carla_load_file(). - # Returned string uses this syntax: - # @code - # "*.ext1;*.ext2;*.ext3" - # @endcode + # Get the list of supported file extensions in carla_load_file(). def get_supported_file_extensions(self): - return charPtrToString(self.lib.carla_get_supported_file_extensions()) + return charPtrPtrToStringList(self.lib.carla_get_supported_file_extensions()) + + # Get the list of supported features in the current Carla build. + def get_supported_features(self): + return charPtrPtrToStringList(self.lib.carla_get_supported_features()) # Get how many internal plugins are available. def get_cached_plugin_count(self, ptype, pluginPath): diff --git a/source/widgets/racklistwidget.py b/source/widgets/racklistwidget.py index 0ef5a6685..942b0bfb3 100644 --- a/source/widgets/racklistwidget.py +++ b/source/widgets/racklistwidget.py @@ -194,16 +194,9 @@ class RackListWidget(QListWidget): host = CarlaHostNull() self.host = host - exts = gCarla.utils.get_supported_file_extensions().split(";") + exts = gCarla.utils.get_supported_file_extensions() - if WINDOWS or (LINUX and not MACOS): - # FIXME not for disabled bridges - exts.append(".dll") - - if not (MACOS or WINDOWS): - exts.append(".so") - - self.fSupportedExtensions = tuple(i.replace("*","").lower() for i in exts) + self.fSupportedExtensions = tuple(("." + i) for i in exts) self.fLastSelectedItem = None self.fWasLastDragValid = False From 6fdb48cc03836d3782f070a8fc4125ad57f7eef3 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 15 Apr 2018 23:15:35 +0200 Subject: [PATCH 5/6] Disable link and kits search UI elements if not compiled in --- source/carla_database.py | 33 ++++++++++++++++++++++++--------- source/carla_host.py | 15 +++++++++++---- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/source/carla_database.py b/source/carla_database.py index c98c9001f..43645b27f 100755 --- a/source/carla_database.py +++ b/source/carla_database.py @@ -830,7 +830,7 @@ class SearchPluginsThread(QThread): def _pluginLook(self, percent, plugin): self.pluginLook.emit(percent, plugin) -# ---------------------------------------------------------------------------------------------------------------------- +# --------------------------------------------------------------------------------------------------------------------- # Plugin Refresh Dialog class PluginRefreshW(QDialog): @@ -844,7 +844,7 @@ class PluginRefreshW(QDialog): # kdevelop likes this :) self.host = host = CarlaHostNull() - # -------------------------------------------------------------------------------------------------------------- + # ------------------------------------------------------------------------------------------------------------- # Internal stuff hasNative = os.path.exists(os.path.join(self.host.pathBinaries, "carla-discovery-native")) @@ -857,7 +857,7 @@ class PluginRefreshW(QDialog): self.fIconYes = getIcon("dialog-ok-apply").pixmap(16, 16) self.fIconNo = getIcon("dialog-error").pixmap(16, 16) - # -------------------------------------------------------------------------------------------------------------- + # ------------------------------------------------------------------------------------------------------------- # Set-up GUI self.ui.b_skip.setVisible(False) @@ -949,12 +949,12 @@ class PluginRefreshW(QDialog): self.ui.ch_dssi.setEnabled(False) self.ui.ch_vst.setEnabled(False) - # -------------------------------------------------------------------------------------------------------------- + # ------------------------------------------------------------------------------------------------------------- # Load settings self.loadSettings() - # ---------------------------------------------------------------------------------------------------- + # ------------------------------------------------------------------------------------------------------------- # Hide bridges if disabled if not host.showPluginBridges: @@ -995,12 +995,27 @@ class PluginRefreshW(QDialog): self.ui.label_win32.hide() self.ui.label_win64.hide() - # ---------------------------------------------------------------------------------------------------- + # Disable non-supported features + features = gCarla.utils.get_supported_features() + + if "gig" not in features: + self.ui.ch_gig.setChecked(False) + self.ui.ch_gig.setEnabled(False) + + if "sf2" not in features: + self.ui.ch_sf2.setChecked(False) + self.ui.ch_sf2.setEnabled(False) + + if "sfz" not in features: + self.ui.ch_sfz.setChecked(False) + self.ui.ch_sfz.setEnabled(False) + + # ------------------------------------------------------------------------------------------------------------- # Resize to minimum size, as it's very likely UI stuff was hidden self.resize(self.minimumSize()) - # -------------------------------------------------------------------------------------------------------------- + # ------------------------------------------------------------------------------------------------------------- # Set-up connections self.finished.connect(self.slot_saveSettings) @@ -1021,12 +1036,12 @@ class PluginRefreshW(QDialog): self.fThread.pluginLook.connect(self.slot_handlePluginLook) self.fThread.finished.connect(self.slot_handlePluginThreadFinished) - # -------------------------------------------------------------------------------------------------------------- + # ------------------------------------------------------------------------------------------------------------- # Post-connect setup self.slot_checkTools() - # ------------------------------------------------------------------------------------------------------------------ + # ----------------------------------------------------------------------------------------------------------------- def loadSettings(self): settings = QSettings("falkTX", "CarlaRefresh2") diff --git a/source/carla_host.py b/source/carla_host.py index e7b7cb0f8..2634b7f72 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -519,16 +519,23 @@ class HostWindow(QMainWindow): self.ui.text_logs.clear() self.setProperWindowTitle() + # Disable non-supported features + features = gCarla.utils.get_supported_features() + + if "link" not in features: + self.ui.cb_transport_link.setEnabled(False) + self.ui.cb_transport_link.setVisible(False) + + # Plugin needs to have timers always running so it receives messages + if self.host.isPlugin: + self.startTimers() + # Qt needs this so it properly creates & resizes the canvas self.ui.tabWidget.blockSignals(True) self.ui.tabWidget.setCurrentIndex(1) self.ui.tabWidget.setCurrentIndex(0) self.ui.tabWidget.blockSignals(False) - # Plugin needs to have timers always running so it receives messages - if self.host.isPlugin: - self.startTimers() - # Start in patchbay tab if using forced patchbay mode if host.processModeForced and host.processMode == ENGINE_PROCESS_MODE_PATCHBAY and not host.isControl: self.ui.tabWidget.setCurrentIndex(1) From 6c12b091de2324f8139abce2c63d460a330cacbd Mon Sep 17 00:00:00 2001 From: Julian Wolff Date: Thu, 19 Apr 2018 19:23:13 +0200 Subject: [PATCH 6/6] fix #619, wrong assertion on MIDI CC param --- source/backend/engine/CarlaEngineData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/backend/engine/CarlaEngineData.cpp b/source/backend/engine/CarlaEngineData.cpp index fd14a3dda..8b499eb5e 100644 --- a/source/backend/engine/CarlaEngineData.cpp +++ b/source/backend/engine/CarlaEngineData.cpp @@ -32,7 +32,7 @@ uint8_t EngineControlEvent::convertToMidiData(const uint8_t channel, uint8_t dat break; case kEngineControlEventTypeParameter: - CARLA_SAFE_ASSERT_RETURN(param >= MAX_MIDI_VALUE, 0); + CARLA_SAFE_ASSERT_RETURN(param < MAX_MIDI_VALUE, 0); data[0] = static_cast(MIDI_STATUS_CONTROL_CHANGE | (channel & MIDI_CHANNEL_BIT));