Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update carla and dpf, do the same changes as in Cardinal side
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Sep 19, 2023
1 parent 2b4999c commit 338f46a
Show file tree
Hide file tree
Showing 7 changed files with 209 additions and 21 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -8,6 +8,7 @@ include dpf/Makefile.base.mk

# also set in:
# plugins/Common/IldaeilPlugin.cpp `getVersion`
# plugins/Standalone/macOS/Info.plist
VERSION = 1.3

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion carla
Submodule carla updated 42 files
+2 −1 Makefile
+3 −0 cmake/CMakeLists.txt
+0 −1 source/backend/CarlaBackend.h
+137 −114 source/backend/CarlaUtils.h
+26 −26 source/backend/engine/CarlaEngineNative.cpp
+50 −44 source/backend/plugin/CarlaPluginBridge.cpp
+29 −11 source/backend/plugin/CarlaPluginCLAP.cpp
+5 −0 source/backend/plugin/CarlaPluginLADSPADSSI.cpp
+2 −2 source/backend/plugin/CarlaPluginLV2.cpp
+8 −4 source/backend/plugin/CarlaPluginVST2.cpp
+228 −62 source/backend/plugin/CarlaPluginVST3.cpp
+1 −0 source/backend/utils/Makefile
+17 −5 source/backend/utils/PipeClient.cpp
+206 −31 source/backend/utils/PluginDiscovery.cpp
+10 −5 source/discovery/Makefile
+45 −2 source/discovery/carla-discovery.cpp
+25 −7 source/frontend/CarlaFrontend.h
+33 −10 source/frontend/carla_frontend.py
+180 −86 source/frontend/carla_host.py
+4 −0 source/frontend/carla_shared.py
+222 −84 source/frontend/pluginlist/pluginlistdialog.cpp
+5 −7 source/frontend/pluginlist/pluginlistdialog.hpp
+1 −1 source/includes/CarlaNativeExtUI.hpp
+4 −0 source/jackbridge/JackBridge.hpp
+70 −5 source/jackbridge/JackBridge2.cpp
+7 −4 source/jackbridge/JackBridge3.cpp
+32 −10 source/jackbridge/JackBridgeExport.cpp
+9 −1 source/jackbridge/JackBridgeExport.hpp
+8 −1 source/jackbridge/Makefile
+59 −59 source/modules/zita-resampler/cresampler.cc
+50 −35 source/modules/zita-resampler/resampler-table.cc
+1 −1 source/modules/zita-resampler/resampler-table.h
+183 −100 source/modules/zita-resampler/resampler.cc
+13 −12 source/modules/zita-resampler/resampler.h
+237 −126 source/modules/zita-resampler/vresampler.cc
+13 −12 source/modules/zita-resampler/vresampler.h
+8 −7 source/native-plugins/audio-base.hpp
+1 −1 source/native-plugins/midi-pattern.cpp
+1 −1 source/utils/CarlaBinaryUtils.hpp
+42 −35 source/utils/CarlaPipeUtils.cpp
+12 −4 source/utils/CarlaPipeUtils.hpp
+2 −2 source/utils/CarlaRingBuffer.hpp
2 changes: 1 addition & 1 deletion plugins/Common/IldaeilBasePlugin.hpp
Expand Up @@ -41,7 +41,7 @@ class IldaeilBasePlugin : public Plugin
NativeHostDescriptor fCarlaHostDescriptor;
CarlaHostHandle fCarlaHostHandle;

String fDiscoveryTool;
String fBinaryPath;

void* fUI;

Expand Down
65 changes: 57 additions & 8 deletions plugins/Common/IldaeilPlugin.cpp
Expand Up @@ -141,6 +141,25 @@ static const char* getPathForVST2()
path += water::File::getSpecialLocation(water::File::winCommonProgramFiles).getFullPathName() + "\\VST2";
#else
path = getHomePath() + "/.vst:/usr/lib/vst:/usr/local/lib/vst";

water::String winePrefix;
if (const char* const envWINEPREFIX = std::getenv("WINEPREFIX"))
winePrefix = envWINEPREFIX;

if (winePrefix.isEmpty())
winePrefix = getHomePath() + "/.wine";

if (water::File(winePrefix).exists())
{
path += ":" + winePrefix + "/drive_c/Program Files/Common Files/VST2";
path += ":" + winePrefix + "/drive_c/Program Files/VstPlugins";
path += ":" + winePrefix + "/drive_c/Program Files/Steinberg/VstPlugins";
#ifdef CARLA_OS_64BIT
path += ":" + winePrefix + "/drive_c/Program Files (x86)/Common Files/VST2";
path += ":" + winePrefix + "/drive_c/Program Files (x86)/VstPlugins";
path += ":" + winePrefix + "/drive_c/Program Files (x86)/Steinberg/VstPlugins";
#endif
}
#endif
}

Expand All @@ -164,6 +183,21 @@ static const char* getPathForVST3()
path += water::File::getSpecialLocation(water::File::winCommonProgramFiles).getFullPathName() + "\\VST3";
#else
path = getHomePath() + "/.vst3:/usr/lib/vst3:/usr/local/lib/vst3";

water::String winePrefix;
if (const char* const envWINEPREFIX = std::getenv("WINEPREFIX"))
winePrefix = envWINEPREFIX;

if (winePrefix.isEmpty())
winePrefix = getHomePath() + "/.wine";

if (water::File(winePrefix).exists())
{
path += ":" + winePrefix + "/drive_c/Program Files/Common Files/VST3";
#ifdef CARLA_OS_64BIT
path += ":" + winePrefix + "/drive_c/Program Files (x86)/Common Files/VST3";
#endif
}
#endif
}

Expand All @@ -187,6 +221,21 @@ static const char* getPathForCLAP()
path += water::File::getSpecialLocation(water::File::winCommonProgramFiles).getFullPathName() + "\\CLAP";
#else
path = getHomePath() + "/.clap:/usr/lib/clap:/usr/local/lib/clap";

water::String winePrefix;
if (const char* const envWINEPREFIX = std::getenv("WINEPREFIX"))
winePrefix = envWINEPREFIX;

if (winePrefix.isEmpty())
winePrefix = getHomePath() + "/.wine";

if (water::File(winePrefix).exists())
{
path += ":" + winePrefix + "/drive_c/Program Files/Common Files/CLAP";
#ifdef CARLA_OS_64BIT
path += ":" + winePrefix + "/drive_c/Program Files (x86)/Common Files/CLAP";
#endif
}
#endif
}

Expand Down Expand Up @@ -352,35 +401,35 @@ class IldaeilPlugin : public IldaeilBasePlugin
if (bundlePath != nullptr
&& water::File(bundlePath + water::String(DISTRHO_OS_SEP_STR "carla-bridge-native" EXT)).existsAsFile())
{
fDiscoveryTool = bundlePath;
fBinaryPath = bundlePath;
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_BINARIES, 0, bundlePath);
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_RESOURCES, 0, getResourcePath(bundlePath));
}
#ifdef CARLA_OS_MAC
else if (bundlePath != nullptr
&& water::File(bundlePath + water::String("/Contents/MacOS/carla-bridge-native" EXT)).existsAsFile())
{
fDiscoveryTool = bundlePath;
fDiscoveryTool += "/Contents/MacOS";
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_BINARIES, 0, fDiscoveryTool);
fBinaryPath = bundlePath;
fBinaryPath += "/Contents/MacOS";
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_BINARIES, 0, fBinaryPath);
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_RESOURCES, 0, getResourcePath(bundlePath));
}
#endif
else
{
#ifdef CARLA_OS_MAC
fDiscoveryTool = "/Applications/Carla.app/Contents/MacOS";
fBinaryPath = "/Applications/Carla.app/Contents/MacOS";
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_BINARIES, 0, "/Applications/Carla.app/Contents/MacOS");
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_RESOURCES, 0, "/Applications/Carla.app/Contents/MacOS/resources");
#else
fDiscoveryTool = "/usr/lib/carla";
fBinaryPath = "/usr/lib/carla";
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_BINARIES, 0, "/usr/lib/carla");
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_RESOURCES, 0, "/usr/share/carla/resources");
#endif
}

carla_stdout("Using binary path: %s", fDiscoveryTool.buffer());
fDiscoveryTool += DISTRHO_OS_SEP_STR "carla-discovery-native" EXT;
if (fBinaryPath.isNotEmpty())
carla_stdout("Using binary path for discovery tools: %s", fBinaryPath.buffer());

#undef EXT

Expand Down
149 changes: 140 additions & 9 deletions plugins/Common/IldaeilUI.cpp
Expand Up @@ -166,6 +166,7 @@ class IldaeilUI : public UI,
IldaeilBasePlugin* const fPlugin;
PluginHostWindow fPluginHostWindow;

BinaryType fBinaryType;
PluginType fPluginType;
PluginType fNextPluginType;
uint fPluginId;
Expand All @@ -174,6 +175,7 @@ class IldaeilUI : public UI,
bool fPluginHasEmbedUI;
bool fPluginHasFileOpen;
bool fPluginHasOutputParameters;
bool fPluginIsBridge;
bool fPluginRunning;
bool fPluginWillRunInBridgeMode;
Mutex fPluginsMutex;
Expand All @@ -185,7 +187,7 @@ class IldaeilUI : public UI,
bool fPluginSearchFirstShow;
char fPluginSearchString[0xff];

String fPopupError, fPluginFilename;
String fPopupError, fPluginFilename, fDiscoveryTool;
Size<uint> fNextSize;

struct RunnerData {
Expand Down Expand Up @@ -216,6 +218,7 @@ class IldaeilUI : public UI,
fIdleState(kIdleInit),
fPlugin((IldaeilBasePlugin*)getPluginInstancePointer()),
fPluginHostWindow(getWindow(), this),
fBinaryType(BINARY_NATIVE),
fPluginType(PLUGIN_LV2),
fNextPluginType(fPluginType),
fPluginId(0),
Expand All @@ -224,6 +227,7 @@ class IldaeilUI : public UI,
fPluginHasEmbedUI(false),
fPluginHasFileOpen(false),
fPluginHasOutputParameters(false),
fPluginIsBridge(false),
fPluginRunning(false),
fPluginWillRunInBridgeMode(false),
fCurrentPluginInfo(),
Expand Down Expand Up @@ -344,6 +348,8 @@ class IldaeilUI : public UI,
#endif
fPluginHasFileOpen = false;
}

fPluginIsBridge = hints & PLUGIN_IS_BRIDGE;
}

void projectLoadedFromDSP()
Expand Down Expand Up @@ -810,20 +816,36 @@ class IldaeilUI : public UI,
}

d_stdout("Will scan plugins now...");
fRunnerData.handle = carla_plugin_discovery_start(fPlugin->fDiscoveryTool,
fPluginType,
IldaeilBasePlugin::getPluginPath(fPluginType),
_binaryPluginSearchCallback,
_binaryPluginCheckCacheCallback,
this);

const String& binaryPath(fPlugin->fBinaryPath);

if (binaryPath.isNotEmpty())
{
fBinaryType = BINARY_NATIVE;

fDiscoveryTool = binaryPath;
fDiscoveryTool += DISTRHO_OS_SEP_STR "carla-discovery-native";
#ifdef CARLA_OS_WIN
fDiscoveryTool += ".exe";
#endif

fRunnerData.handle = carla_plugin_discovery_start(fDiscoveryTool,
fBinaryType,
fPluginType,
IldaeilBasePlugin::getPluginPath(fPluginType),
_binaryPluginSearchCallback,
_binaryPluginCheckCacheCallback,
this);

}

if (fDrawingState == kDrawingLoading)
{
fDrawingState = kDrawingPluginList;
fPluginSearchFirstShow = true;
}

if (fRunnerData.handle == nullptr)
if (binaryPath.isEmpty() || (fRunnerData.handle == nullptr && !startNextDiscovery()))
{
d_stdout("Nothing found!");
return false;
Expand All @@ -836,11 +858,103 @@ class IldaeilUI : public UI,
return true;

// stop here
d_stdout("Found %lu plugins!", (ulong)fPlugins.size());
carla_plugin_discovery_stop(fRunnerData.handle);
fRunnerData.handle = nullptr;

if (startNextDiscovery())
return true;

d_stdout("Found %lu plugins!", (ulong)fPlugins.size());
return false;
}

bool startNextDiscovery()
{
if (! setNextDiscoveryTool())
return false;

fRunnerData.handle = carla_plugin_discovery_start(fDiscoveryTool,
fBinaryType,
fPluginType,
IldaeilBasePlugin::getPluginPath(fPluginType),
_binaryPluginSearchCallback,
_binaryPluginCheckCacheCallback,
this);

if (fRunnerData.handle == nullptr)
return startNextDiscovery();

return true;
}

bool setNextDiscoveryTool()
{
switch (fPluginType)
{
case PLUGIN_VST2:
case PLUGIN_VST3:
case PLUGIN_CLAP:
break;
default:
return false;
}

#ifdef CARLA_OS_WIN
#ifdef CARLA_OS_WIN64
// look for win32 plugins on win64
if (fBinaryType == BINARY_NATIVE)
{
fBinaryType = BINARY_WIN32;
fDiscoveryTool = fPlugin->fBinaryPath;
fDiscoveryTool += CARLA_OS_SEP_STR "carla-discovery-win32.exe";

if (water::File(fDiscoveryTool.buffer()).existsAsFile())
return true;
}
#endif

// no other types to try
return false;
#else // CARLA_OS_WIN

#ifndef CARLA_OS_MAC
// try 32bit plugins on 64bit systems, skipping macOS where 32bit is no longer supported
if (fBinaryType == BINARY_NATIVE)
{
fBinaryType = BINARY_POSIX32;
fDiscoveryTool = fPlugin->fBinaryPath;
fDiscoveryTool += CARLA_OS_SEP_STR "carla-discovery-posix32";

if (water::File(fDiscoveryTool.buffer()).existsAsFile())
return true;
}
#endif

// try wine bridges
#ifdef CARLA_OS_64BIT
if (fBinaryType == BINARY_NATIVE || fBinaryType == BINARY_POSIX32)
{
fBinaryType = BINARY_WIN64;
fDiscoveryTool = fPlugin->fBinaryPath;
fDiscoveryTool += CARLA_OS_SEP_STR "carla-discovery-win64.exe";

if (water::File(fDiscoveryTool.buffer()).existsAsFile())
return true;
}
#endif

if (fBinaryType != BINARY_WIN32)
{
fBinaryType = BINARY_WIN32;
fDiscoveryTool = fPlugin->fBinaryPath;
fDiscoveryTool += CARLA_OS_SEP_STR "carla-discovery-win32.exe";

if (water::File(fDiscoveryTool.buffer()).existsAsFile())
return true;
}

return false;
#endif // CARLA_OS_WIN
}

void binaryPluginSearchCallback(const CarlaPluginDiscoveryInfo* const info, const char* const sha1sum)
Expand Down Expand Up @@ -1279,6 +1393,23 @@ class IldaeilUI : public UI,
{
const CarlaHostHandle handle = fPlugin->fCarlaHostHandle;

if (fPluginIsBridge)
{
const bool active = carla_get_internal_parameter_value(handle, 0, PARAMETER_ACTIVE) > 0.5f;

if (active)
{
ImGui::BeginDisabled();
ImGui::Button("Reload bridge");
ImGui::EndDisabled();
}
else
{
if (ImGui::Button("Reload bridge"))
carla_set_active(handle, 0, true);
}
}

if (ui->presetCount != 0)
{
ImGui::Text("Preset:");
Expand Down
9 changes: 8 additions & 1 deletion plugins/Standalone/macOS/Info.plist
Expand Up @@ -9,7 +9,14 @@
<key>CFBundleIconFile</key>
<string>distrho.icns</string>
<key>CFBundleIdentifier</key>
<string>Ildaeil</string>
<string>studio.kx.distrho.ildaeil</string>
<key>CFBundleShortVersionString</key>
<string>1.3</string>
<key>LSMinimumSystemVersion</key>
<string>10.8</string>
<key>NSHumanReadableCopyright</key>
<string>(C) 2011-2023 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 published by the Free Software Foundation; either version 3 of the License, or any later version.</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSRequiresAquaSystemAppearance</key>
Expand Down

0 comments on commit 338f46a

Please sign in to comment.