diff --git a/boilerplate/effect-plugin/CMakeLists.txt b/boilerplate/effect-plugin-webview/CMakeLists.txt similarity index 100% rename from boilerplate/effect-plugin/CMakeLists.txt rename to boilerplate/effect-plugin-webview/CMakeLists.txt diff --git a/boilerplate/effect-plugin-webview/source/PluginEditor.cpp b/boilerplate/effect-plugin-webview/source/PluginEditor.cpp new file mode 100644 index 0000000..f4a494e --- /dev/null +++ b/boilerplate/effect-plugin-webview/source/PluginEditor.cpp @@ -0,0 +1,12 @@ +// +// Created by Syl on 17/08/2024. +// +#include "PluginEditor.h" +PluginEditor::PluginEditor(std::uint32_t width, std::uint32_t height) : mostly_harmless::gui::WebviewEditor(width, height) { +} + +void PluginEditor::initialise(mostly_harmless::gui::EditorContext /*context*/) { +} + +void PluginEditor::onParamEvent(mostly_harmless::events::ProcToGuiParamEvent /*event*/) { +} \ No newline at end of file diff --git a/boilerplate/effect-plugin-webview/source/PluginEditor.h b/boilerplate/effect-plugin-webview/source/PluginEditor.h new file mode 100644 index 0000000..f93d377 --- /dev/null +++ b/boilerplate/effect-plugin-webview/source/PluginEditor.h @@ -0,0 +1,16 @@ +// +// Created by Syl on 17/08/2024. +// + +#ifndef MOSTLYHARMLESS_PLUGINEDITOR_H +#define MOSTLYHARMLESS_PLUGINEDITOR_H +#include +class PluginEditor : public mostly_harmless::gui::WebviewEditor { +public: + PluginEditor(std::uint32_t width, std::uint32_t height); + void initialise(mostly_harmless::gui::EditorContext context) override; + void onParamEvent(mostly_harmless::events::ProcToGuiParamEvent event) override; + +private: +}; +#endif // MOSTLYHARMLESS_PLUGINEDITOR_H diff --git a/boilerplate/effect-plugin/source/PluginProcessor.cpp b/boilerplate/effect-plugin-webview/source/PluginProcessor.cpp similarity index 66% rename from boilerplate/effect-plugin/source/PluginProcessor.cpp rename to boilerplate/effect-plugin-webview/source/PluginProcessor.cpp index 3e14d15..36b3370 100644 --- a/boilerplate/effect-plugin/source/PluginProcessor.cpp +++ b/boilerplate/effect-plugin-webview/source/PluginProcessor.cpp @@ -8,28 +8,28 @@ std::vector> createParams() { return {}; } PluginProcessor::PluginProcessor(const clap_host* host) : mostly_harmless::Plugin(host, createParams()) { - } void PluginProcessor::initialise(double /*sampleRate*/, std::uint32_t /*minFrames*/, std::uint32_t /*maxFrames*/) noexcept { - } -void PluginProcessor::process(marvin::containers::BufferView /*bufferView*/, - mostly_harmless::EventContext /*eventContext*/) noexcept { - +void PluginProcessor::process(marvin::containers::BufferView /*bufferView*/, mostly_harmless::events::InputEventContext /*eventContext*/) noexcept { } -void PluginProcessor::flushParams(mostly_harmless::EventContext /*eventContext*/) noexcept { - +void PluginProcessor::flushParams(mostly_harmless::events::InputEventContext /*eventContext*/) noexcept { } void PluginProcessor::reset() noexcept { +} + +void PluginProcessor::loadState(std::string_view /*loaded*/) { +} +void PluginProcessor::saveState(std::ostringstream& /*dest*/) { } std::unique_ptr PluginProcessor::createEditor() noexcept { - return std::make_unique(400, 400); + return nullptr; } MOSTLYHARMLESS_REGISTER(PluginProcessor) diff --git a/boilerplate/effect-plugin/source/PluginProcessor.h b/boilerplate/effect-plugin-webview/source/PluginProcessor.h similarity index 66% rename from boilerplate/effect-plugin/source/PluginProcessor.h rename to boilerplate/effect-plugin-webview/source/PluginProcessor.h index 26f3ef7..744bc3f 100644 --- a/boilerplate/effect-plugin/source/PluginProcessor.h +++ b/boilerplate/effect-plugin-webview/source/PluginProcessor.h @@ -10,11 +10,13 @@ class PluginProcessor : public mostly_harmless::Plugin { PluginProcessor(const clap_host* host); ~PluginProcessor() noexcept override = default; void initialise(double sampleRate, std::uint32_t minFrames, std::uint32_t maxFrames) noexcept override; - void process(marvin::containers::BufferView bufferView, mostly_harmless::EventContext eventContext) noexcept override; - void flushParams(mostly_harmless::EventContext eventContext) noexcept override; + void process(marvin::containers::BufferView bufferView, mostly_harmless::events::InputEventContext eventContext) noexcept override; + void flushParams(mostly_harmless::events::InputEventContext eventContext) noexcept override; void reset() noexcept override; + void loadState(std::string_view loaded) override; + void saveState(std::ostringstream& dest) override; std::unique_ptr createEditor() noexcept override; -private: +private: }; -#endif //PLUGINPROCESSOR_H +#endif // PLUGINPROCESSOR_H diff --git a/examples/gain/source/Gain.h b/examples/gain/source/Gain.h index aaf99bc..48d61ad 100644 --- a/examples/gain/source/Gain.h +++ b/examples/gain/source/Gain.h @@ -19,7 +19,6 @@ namespace examples::gain { void saveState(std::ostringstream& dest) override; std::unique_ptr createEditor() noexcept override; - private: void checkParameters(); Parameters m_params;