diff --git a/core/audio/plugin_host/plugin_host.h b/core/audio/plugin_host/plugin_host.h index 31dd821..6aff088 100644 --- a/core/audio/plugin_host/plugin_host.h +++ b/core/audio/plugin_host/plugin_host.h @@ -41,7 +41,7 @@ public: [[nodiscard]] uint64_t get_uid() const { return id; } [[nodiscard]] plugin_host_type get_type() const { return type_; } - virtual bool load_plugin(const char* path) = 0; + virtual bool load(const char* path) = 0; virtual void set_enabled(bool enabled) = 0; @@ -100,6 +100,8 @@ public: virtual float get_param_max_value(int32_t index) { return 1.0f; } void init_channel_interface(); + [[nodiscard]] auto is_loading() const -> bool { return loading_; } + void over_loading() { loading_ = false; } std::string name; std::string vendor; @@ -122,8 +124,9 @@ protected: virtual void on_close_editor() = 0; private: - bool editor_opened = false; const uint64_t id = 0; plugin_host_type type_; int32_t user_latency_ = 0; + bool editor_opened = false; + std::atomic loading_ = true; }; diff --git a/core/audio/plugin_host/vst2/vst2_plugin_host.cpp b/core/audio/plugin_host/vst2/vst2_plugin_host.cpp index a61ac0e..979bad9 100644 --- a/core/audio/plugin_host/vst2/vst2_plugin_host.cpp +++ b/core/audio/plugin_host/vst2/vst2_plugin_host.cpp @@ -172,7 +172,7 @@ vst2_plugin_host::~vst2_plugin_host() { effect_ = nullptr; } -bool vst2_plugin_host::load_plugin(const char* path) { +bool vst2_plugin_host::load(const char* path) { // load vst library_ = get_vst2_library(path); // get main function diff --git a/core/audio/plugin_host/vst2/vst2_plugin_host.h b/core/audio/plugin_host/vst2/vst2_plugin_host.h index f217571..bdad33b 100644 --- a/core/audio/plugin_host/vst2/vst2_plugin_host.h +++ b/core/audio/plugin_host/vst2/vst2_plugin_host.h @@ -44,7 +44,7 @@ public: static constexpr auto type = plugin_host_type::vst2; vst2_plugin_host(); ~vst2_plugin_host() override; - bool load_plugin(const char* path) override; + bool load(const char* path) override; void set_enabled(bool enabled) override; [[nodiscard]] bool is_enabled() const override;