Browse Source

Add getBinaryTypeAsString utility function

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.5.5
falkTX 1 year ago
parent
commit
fd42222339
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 30 additions and 0 deletions
  1. +30
    -0
      source/utils/CarlaBackendUtils.hpp

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

@@ -500,6 +500,34 @@ const char* PatchbayIcon2Str(const PatchbayIcon icon) noexcept

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

static inline
const char* getBinaryTypeAsString(const BinaryType type) noexcept
{
carla_debug("CarlaBackend::getBinaryTypeAsString(%i:%s)", type, BinaryType2Str(type));

if (type == BINARY_NATIVE)
return "native";

switch (type)
{
case BINARY_NONE:
return "none";
case BINARY_POSIX32:
return "posix32";
case BINARY_POSIX64:
return "posix64";
case BINARY_WIN32:
return "win32";
case BINARY_WIN64:
return "win64";
case BINARY_OTHER:
return "other";
}

carla_stderr("CarlaBackend::getBinaryTypeAsString(%i) - invalid type", type);
return "NONE";
}

static inline
BinaryType getBinaryTypeFromString(const char* const ctype) noexcept
{
@@ -525,6 +553,8 @@ BinaryType getBinaryTypeFromString(const char* const ctype) noexcept
return BINARY_WIN32;
if (stype == "win64")
return BINARY_WIN64;
if (stype == "other")
return BINARY_OTHER;

carla_stderr("CarlaBackend::getBinaryTypeFromString(\"%s\") - invalid string type", ctype);
return BINARY_NONE;


Loading…
Cancel
Save