From 43b981c58d62e4c1b9ba88f3cde5f106ac3ef791 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 16 Nov 2019 18:50:47 +0000 Subject: [PATCH] Fix default colors for custom skin-style plugins in rack --- source/frontend/carla_skin.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/source/frontend/carla_skin.py b/source/frontend/carla_skin.py index 663a8b405..740eac7e1 100644 --- a/source/frontend/carla_skin.py +++ b/source/frontend/carla_skin.py @@ -1980,48 +1980,49 @@ def getColorAndSkinStyle(host, pluginId): else: progCount = host.get_midi_program_count(pluginId) - color = getColorFromCategory(pluginInfo['category']) + colorCategory = getColorFromCategory(pluginInfo['category']) + colorNone = (0,0,0) # Samplers if pluginInfo['type'] == PLUGIN_SF2: - return (color, "sf2") + return (colorCategory, "sf2") if pluginInfo['type'] == PLUGIN_SFZ: - return (color, "sfz") + return (colorCategory, "sfz") # Calf if pluginName.split(" ", 1)[0].lower() == "calf": - return (color, "calf_black" if "mono" in pluginLabel else "calf_blue") + return (colorNone, "calf_black" if "mono" in pluginLabel else "calf_blue") # OpenAV if pluginMaker == "OpenAV Productions": - return (color, "openav-old") + return (colorNone, "openav-old") if pluginMaker == "OpenAV": - return (color, "openav") + return (colorNone, "openav") # ZynFX if pluginInfo['type'] == PLUGIN_INTERNAL: if pluginLabel.startswith("zyn") and pluginInfo['category'] != PLUGIN_CATEGORY_SYNTH: - return (color, "zynfx") + return (colorNone, "zynfx") if pluginInfo['type'] == PLUGIN_LADSPA: if pluginLabel.startswith("zyn") and pluginMaker.startswith("Josep Andreu"): - return (color, "zynfx") + return (colorNone, "zynfx") if pluginInfo['type'] == PLUGIN_LV2: if pluginLabel.startswith("http://kxstudio.sf.net/carla/plugins/zyn") and pluginName != "ZynAddSubFX": - return (color, "zynfx") + return (colorNone, "zynfx") # Presets if progCount > 1 and (pluginInfo['hints'] & PLUGIN_USES_MULTI_PROGS) == 0: if pluginInfo['type'] in (PLUGIN_VST2, PLUGIN_VST3, PLUGIN_AU): - return (color, "presets") - return (color, "mpresets") + return (colorCategory, "presets") + return (colorCategory, "mpresets") # DISTRHO Plugins (needs to be last) if pluginMaker.startswith("falkTX, ") or pluginMaker == "DISTRHO" or pluginLabel.startswith("http://distrho.sf.net/plugins/"): - return (color, pluginLabel.replace("http://distrho.sf.net/plugins/","")) + return (colorNone, pluginLabel.replace("http://distrho.sf.net/plugins/","")) - return (color, "default") + return (colorCategory, "default") def createPluginSlot(parent, host, pluginId, options): skinColor, skinStyle = getColorAndSkinStyle(host, pluginId)