6#include "plugins/CLAPPluginFormat.h"
7#include "utils/file_path_list.h"
9#include <juce_audio_processors/juce_audio_processors.h>
11namespace zrythm::test_helpers
18template <
typename FormatType>
19std::unique_ptr<juce::PluginDescription>
20find_bundled_plugin_by_name (
21 const QString &search_paths_str,
22 const juce::String &target_name)
24 if (search_paths_str.isEmpty ())
27 auto paths = std::make_unique<utils::FilePathList> ();
28 QStringList path_list = search_paths_str.split (
":::", Qt::SkipEmptyParts);
29 for (
const auto &path : path_list)
30 paths->add_path (std::filesystem::path (path.toStdString ()));
36 auto juce_search_paths = paths->get_as_juce_file_search_path ();
38 format.searchPathsForPlugins (juce_search_paths,
false,
false);
39 for (
const auto &
id : identifiers)
41 juce::OwnedArray<juce::PluginDescription> descriptions;
42 format.findAllTypesForFile (descriptions,
id);
43 for (
const auto * desc : descriptions)
45 if (desc->name == target_name)
46 return std::make_unique<juce::PluginDescription> (*desc);
52inline std::unique_ptr<juce::PluginDescription>
53find_bundled_vst3_plugin_by_name (
const juce::String &target_name)
55 return find_bundled_plugin_by_name<juce::VST3PluginFormat> (
56 QStringLiteral (BUNDLED_VST3_SEARCH_PATHS), target_name);
59inline std::unique_ptr<juce::PluginDescription>
60find_bundled_clap_plugin_by_name (
const juce::String &target_name)
62 return find_bundled_plugin_by_name<plugins::CLAPPluginFormat> (
63 QStringLiteral (BUNDLED_CLAP_SEARCH_PATHS), target_name);