Browse Source

discovery: print category as a string, for internal plugins too

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 5 years ago
parent
commit
d2ee2b1972
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 48 additions and 6 deletions
  1. +5
    -6
      source/discovery/carla-discovery.cpp
  2. +43
    -0
      source/utils/CarlaBackendUtils.hpp

+ 5
- 6
source/discovery/carla-discovery.cpp View File

@@ -1,6 +1,6 @@
/*
* Carla Plugin discovery
* Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2011-2020 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -103,6 +103,7 @@ static void print_cached_plugin(const CarlaCachedPluginInfo* const pinfo)
DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("build", BINARY_NATIVE);
DISCOVERY_OUT("hints", pinfo->hints);
DISCOVERY_OUT("category", getPluginCategoryAsString(pinfo->category));
DISCOVERY_OUT("name", pinfo->name);
DISCOVERY_OUT("maker", pinfo->maker);
DISCOVERY_OUT("label", pinfo->label);
@@ -1054,7 +1055,7 @@ static void do_vst_check(lib_t& libHandle, const char* const filename, const boo
CarlaString cName;
CarlaString cProduct;
CarlaString cVendor;
uint category;
PluginCategory category;
LinkedList<intptr_t> uniqueIds;

if (isShell)
@@ -1124,8 +1125,7 @@ static void do_vst_check(lib_t& libHandle, const char* const filename, const boo
cVendor.clear();

// get category
const intptr_t effCategory = effect->dispatcher(effect, effGetPlugCategory, 0, 0, NULL, 0.0f);
switch (effCategory)
switch (effect->dispatcher(effect, effGetPlugCategory, 0, 0, nullptr, 0.0f))
{
case kPlugCategSynth:
category = PLUGIN_CATEGORY_SYNTH;
@@ -1153,7 +1153,6 @@ static void do_vst_check(lib_t& libHandle, const char* const filename, const boo
break;
}


// get everything else
uint hints = 0x0;
uint audioIns = static_cast<uint>(std::max(0, effect->numInputs));
@@ -1288,7 +1287,7 @@ static void do_vst_check(lib_t& libHandle, const char* const filename, const boo
DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("build", BINARY_NATIVE);
DISCOVERY_OUT("hints", hints);
DISCOVERY_OUT("category", category);
DISCOVERY_OUT("category", getPluginCategoryAsString(category));
DISCOVERY_OUT("name", cName.buffer());
DISCOVERY_OUT("label", cProduct.buffer());
DISCOVERY_OUT("maker", cVendor.buffer());


+ 43
- 0
source/utils/CarlaBackendUtils.hpp View File

@@ -518,6 +518,39 @@ BinaryType getBinaryTypeFromString(const char* const ctype) noexcept

// -----------------------------------------------------------------------

static inline
const char* getPluginCategoryAsString(const PluginCategory category) noexcept
{
carla_debug("CarlaBackend::getPluginCategoryAsString(%i:%s)", category, PluginCategory2Str(category));

switch (category)
{
case PLUGIN_CATEGORY_NONE:
return "none";
case PLUGIN_CATEGORY_SYNTH:
return "synth";
case PLUGIN_CATEGORY_DELAY:
return "delay";
case PLUGIN_CATEGORY_EQ:
return "eq";
case PLUGIN_CATEGORY_FILTER:
return "filter";
case PLUGIN_CATEGORY_DISTORTION:
return "distortion";
case PLUGIN_CATEGORY_DYNAMICS:
return "dynamics";
case PLUGIN_CATEGORY_MODULATOR:
return "modulator";
case PLUGIN_CATEGORY_UTILITY:
return "utility";
case PLUGIN_CATEGORY_OTHER:
return "other";
}

carla_stderr("CarlaBackend::getPluginCategoryAsString(%i) - invalid category", category);
return "NONE";
}

static inline
const char* getPluginTypeAsString(const PluginType type) noexcept
{
@@ -680,6 +713,16 @@ PluginCategory getPluginCategoryFromName(const char* const name) noexcept
if (sname.contains("tool"))
return PLUGIN_CATEGORY_UTILITY;

// synth
if (sname.contains("synth"))
return PLUGIN_CATEGORY_SYNTH;

// other
if (sname.contains("misc"))
return PLUGIN_CATEGORY_OTHER;
if (sname.contains("other"))
return PLUGIN_CATEGORY_OTHER;

return PLUGIN_CATEGORY_NONE;
}



Loading…
Cancel
Save