Browse Source

Enable JSFX plugin support in Ildaeil

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.06
falkTX 3 years ago
parent
commit
20e6f30bcc
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
5 changed files with 71 additions and 17 deletions
  1. +1
    -1
      carla
  2. +50
    -3
      plugins/Cardinal/src/Ildaeil.cpp
  3. +18
    -13
      src/CardinalCommon.cpp
  4. +1
    -0
      src/CardinalCommon.hpp
  5. +1
    -0
      src/Makefile.cardinal.mk

+ 1
- 1
carla

@@ -1 +1 @@
Subproject commit 54effcd901f4540aff9ff933880941d9153bd50a
Subproject commit 0972c333b4de0a53a5bfb9731d558965e0010f7d

+ 50
- 3
plugins/Cardinal/src/Ildaeil.cpp View File

@@ -52,6 +52,19 @@ json_t *jsonp_stringn_nocheck_own(const char* value, size_t len);
} }
#endif #endif


// defined elsewhere
namespace rack {
#ifdef ARCH_WIN
enum SpecialPath {
kSpecialPathUserProfile,
kSpecialPathCommonProgramFiles,
kSpecialPathAppData,
};
std::string getSpecialPath(const SpecialPath type)
#endif
std::string homeDir();
}

#define BUFFER_SIZE 128 #define BUFFER_SIZE 128


// generates a warning if this is defined as anything else // generates a warning if this is defined as anything else
@@ -97,6 +110,28 @@ static void projectLoadedFromDSP(void* ui);


static Mutex sPluginInfoLoadMutex; static Mutex sPluginInfoLoadMutex;


static const char* getPathForJSFX()
{
static std::string path;

if (path.empty())
{
#if defined(CARLA_OS_MAC)
path = homeDir() + "/Library/Application Support/REAPER/Effects";
#elif defined(CARLA_OS_WIN)
path = getSpecialPath() + "\\REAPER\\Effects"
#else
if (const char* const configHome = std::getenv("XDG_CONFIG_HOME"))
path = configHome;
else
path = homeDir() + "/.config";
path += "/REAPER/Effects";
#endif
}

return path.c_str();
}

/* /*
#ifndef HEADLESS #ifndef HEADLESS
struct JuceInitializer { struct JuceInitializer {
@@ -249,6 +284,8 @@ struct IldaeilModule : Module {
if (const char* const path = std::getenv("LV2_PATH")) if (const char* const path = std::getenv("LV2_PATH"))
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PLUGIN_PATH, PLUGIN_LV2, path); carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PLUGIN_PATH, PLUGIN_LV2, path);


carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PLUGIN_PATH, PLUGIN_JSFX, getPathForJSFX());

#ifdef CARLA_OS_MAC #ifdef CARLA_OS_MAC
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PREFER_UI_BRIDGES, 0, nullptr); carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PREFER_UI_BRIDGES, 0, nullptr);
#endif #endif
@@ -1068,7 +1105,7 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
{ {
case PLUGIN_INTERNAL: case PLUGIN_INTERNAL:
case PLUGIN_AU: case PLUGIN_AU:
// case PLUGIN_JSFX:
case PLUGIN_JSFX:
case PLUGIN_SFZ: case PLUGIN_SFZ:
label = info.label; label = info.label;
break; break;
@@ -1096,6 +1133,9 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
case PLUGIN_LV2: case PLUGIN_LV2:
path = std::getenv("LV2_PATH"); path = std::getenv("LV2_PATH");
break; break;
case PLUGIN_JSFX:
path = getPathForJSFX();
break;
default: default:
path = nullptr; path = nullptr;
break; break;
@@ -1386,6 +1426,7 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
static const char* pluginTypes[] = { static const char* pluginTypes[] = {
getPluginTypeAsString(PLUGIN_INTERNAL), getPluginTypeAsString(PLUGIN_INTERNAL),
getPluginTypeAsString(PLUGIN_LV2), getPluginTypeAsString(PLUGIN_LV2),
getPluginTypeAsString(PLUGIN_JSFX),
}; };


setupMainWindowPos(); setupMainWindowPos();
@@ -1431,6 +1472,9 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
int current; int current;
switch (fPluginType) switch (fPluginType)
{ {
case PLUGIN_JSFX:
current = 2;
break;
case PLUGIN_LV2: case PLUGIN_LV2:
current = 1; current = 1;
break; break;
@@ -1450,6 +1494,9 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
case 1: case 1:
fNextPluginType = PLUGIN_LV2; fNextPluginType = PLUGIN_LV2;
break; break;
case 2:
fNextPluginType = PLUGIN_JSFX;
break;
} }
} }


@@ -1485,7 +1532,7 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
case PLUGIN_INTERNAL: case PLUGIN_INTERNAL:
case PLUGIN_AU: case PLUGIN_AU:
case PLUGIN_SFZ: case PLUGIN_SFZ:
// case PLUGIN_JSFX:
case PLUGIN_JSFX:
ImGui::TableSetupColumn("Name"); ImGui::TableSetupColumn("Name");
ImGui::TableSetupColumn("Label"); ImGui::TableSetupColumn("Label");
ImGui::TableHeadersRow(); ImGui::TableHeadersRow();
@@ -1512,7 +1559,7 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
{ {
case PLUGIN_INTERNAL: case PLUGIN_INTERNAL:
case PLUGIN_AU: case PLUGIN_AU:
// case PLUGIN_JSFX:
case PLUGIN_JSFX:
case PLUGIN_SFZ: case PLUGIN_SFZ:
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);


+ 18
- 13
src/CardinalCommon.cpp View File

@@ -55,6 +55,7 @@
const std::string CARDINAL_VERSION = "22.05"; const std::string CARDINAL_VERSION = "22.05";


namespace rack { namespace rack {

namespace settings { namespace settings {
int rateLimit = 0; int rateLimit = 0;
} }
@@ -76,6 +77,9 @@ std::string getSpecialPath(const SpecialPath type)
case kSpecialPathCommonProgramFiles: case kSpecialPathCommonProgramFiles:
csidl = CSIDL_PROGRAM_FILES_COMMON; csidl = CSIDL_PROGRAM_FILES_COMMON;
break; break;
case kSpecialPathAppData:
csidl = CSIDL_COMMON_APPDATA;
break;
default: default:
return {}; return {};
} }
@@ -88,8 +92,22 @@ std::string getSpecialPath(const SpecialPath type)
return {}; return {};
} }
#endif #endif

std::string homeDir()
{
# ifdef ARCH_WIN
return getSpecialPath(kSpecialPathUserProfile);
# else
if (const char* const home = getenv("HOME"))
return home;
if (struct passwd* const pwd = getpwuid(getuid()))
return pwd->pw_dir;
# endif
return {};
} }


} // namespace rack

namespace patchUtils namespace patchUtils
{ {


@@ -103,19 +121,6 @@ static void promptClear(const char* const message, const std::function<void()> a


asyncDialog::create(message, action); asyncDialog::create(message, action);
} }

static std::string homeDir()
{
# ifdef ARCH_WIN
return getSpecialPath(kSpecialPathUserProfile);
# else
if (const char* const home = getenv("HOME"))
return home;
if (struct passwd* const pwd = getpwuid(getuid()))
return pwd->pw_dir;
# endif
return {};
}
#endif #endif


void loadDialog() void loadDialog()


+ 1
- 0
src/CardinalCommon.hpp View File

@@ -47,6 +47,7 @@ bool isStandalone();
enum SpecialPath { enum SpecialPath {
kSpecialPathUserProfile, kSpecialPathUserProfile,
kSpecialPathCommonProgramFiles, kSpecialPathCommonProgramFiles,
kSpecialPathAppData,
}; };
std::string getSpecialPath(SpecialPath type); std::string getSpecialPath(SpecialPath type);
#endif #endif


+ 1
- 0
src/Makefile.cardinal.mk View File

@@ -43,6 +43,7 @@ CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/lilv.a
CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/rtmempool.a CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/rtmempool.a
CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/sfzero.a CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/sfzero.a
CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/water.a CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/water.a
CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/ysfx.a
CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/zita-resampler.a CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/zita-resampler.a


endif # STATIC_BUILD endif # STATIC_BUILD


Loading…
Cancel
Save