/
reds
/
OpenDAW
Обзор
Документация
Войти
/
reds
/
OpenDAW
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
include/opendaw/plugin/PluginHost.h
93 строки
2 KB
OpenDAW Developer
feat(v0.6.0): Add Plugin Support (CLAP + VST3)
21 фев 2026, 04:44
21 фев 2026, 04:44
ad86a0b
Код
Авторство
О чём код?
#pragma once #include <opendaw/plugin/Plugin.h> #include <opendaw/plugin/ClapPlugin.h> #include <opendaw/plugin/VST3Plugin.h> #include <string> #include <vector> #include <memory> #include <functional> namespace opendaw { /** * @brief Менеджер плагинов * * Поддерживает: * - CLAP плагины * - VST3 плагины */ class PluginHost { public: PluginHost() = default; ~PluginHost() = default; /** * @brief Конфигурация PluginHost */ struct Config { bool enableCLAP{true}; bool enableVST3{true}; bool scanOnStartup{false}; std::vector<std::string> additionalPaths; }; /** * @brief Сканирование всех плагинов */ void scanAllPlugins(); /** * @brief Сканирование конкретной директории */ void scanPath(const std::string& path); /** * @brief Получить список найденных плагинов */ const std::vector<PluginInfo>& getDiscoveredPlugins() const { return discoveredPlugins_; } /** * @brief Загрузить плагин по ID */ Plugin* loadPlugin(const std::string& pluginId); /** * @brief Выгрузить плагин */ void unloadPlugin(Plugin* plugin); /** * @brief Получить поддерживаемые форматы */ std::vector<std::string> getSupportedFormats() const; /** * @brief Callbacks */ using ProgressCallback = std::function<void(const std::string&, float)>; using ErrorCallback = std::function<void(const std::string&, const std::string&)>; void setProgressCallback(ProgressCallback cb) { progressCallback_ = std::move(cb); } void setErrorCallback(ErrorCallback cb) { errorCallback_ = std::move(cb); } private: std::vector<PluginInfo> discoveredPlugins_; std::vector<std::unique_ptr<Plugin>> loadedPlugins_; ClapScanner clapScanner_; VST3Scanner vst3Scanner_; ProgressCallback progressCallback_; ErrorCallback errorCallback_; bool enableCLAP_{true}; bool enableVST3_{true}; void scanCLAP(const std::string& path); void scanVST3(const std::string& path); }; } // namespace opendaw