| @@ -14,6 +14,14 @@ | |||||
| * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
| */ | */ | ||||
| /* TODO items: | |||||
| * CV: write a specification | |||||
| * INFO: define url, manual url, support url and string version | |||||
| * PARAMETERS: test parameter triggers | |||||
| * States: skip DSP/UI only states as appropriate | |||||
| * UI: expose external-only UIs | |||||
| */ | |||||
| #include "DistrhoPluginInternal.hpp" | #include "DistrhoPluginInternal.hpp" | ||||
| #include "extra/ScopedPointer.hpp" | #include "extra/ScopedPointer.hpp" | ||||
| @@ -1070,8 +1078,7 @@ public: | |||||
| fPlugin.run(audioInputs, audioOutputs, frames); | fPlugin.run(audioInputs, audioOutputs, frames); | ||||
| #endif | #endif | ||||
| // TODO set last frame | |||||
| flushParameters(nullptr, process->out_events); | |||||
| flushParameters(nullptr, process->out_events, frames - 1); | |||||
| fOutputEvents = nullptr; | fOutputEvents = nullptr; | ||||
| } | } | ||||
| @@ -1210,7 +1217,9 @@ public: | |||||
| return true; | return true; | ||||
| } | } | ||||
| void flushParameters(const clap_input_events_t* const in, const clap_output_events_t* const out) | |||||
| void flushParameters(const clap_input_events_t* const in, | |||||
| const clap_output_events_t* const out, | |||||
| const uint32_t frameOffset) | |||||
| { | { | ||||
| if (const uint32_t len = in != nullptr ? in->size(in) : 0) | if (const uint32_t len = in != nullptr ? in->size(in) : 0) | ||||
| { | { | ||||
| @@ -1231,7 +1240,7 @@ public: | |||||
| if (out != nullptr) | if (out != nullptr) | ||||
| { | { | ||||
| clap_event_param_value_t clapEvent = { | clap_event_param_value_t clapEvent = { | ||||
| { sizeof(clap_event_param_value_t), 0, 0, CLAP_EVENT_PARAM_VALUE, CLAP_EVENT_IS_LIVE }, | |||||
| { sizeof(clap_event_param_value_t), frameOffset, 0, CLAP_EVENT_PARAM_VALUE, CLAP_EVENT_IS_LIVE }, | |||||
| 0, nullptr, 0, 0, 0, 0, 0.0 | 0, nullptr, 0, 0, 0, 0, 0.0 | ||||
| }; | }; | ||||
| @@ -2336,7 +2345,7 @@ static CLAP_ABI bool clap_plugin_params_text_to_value(const clap_plugin_t* plugi | |||||
| static CLAP_ABI void clap_plugin_params_flush(const clap_plugin_t* plugin, const clap_input_events_t* in, const clap_output_events_t* out) | static CLAP_ABI void clap_plugin_params_flush(const clap_plugin_t* plugin, const clap_input_events_t* in, const clap_output_events_t* out) | ||||
| { | { | ||||
| PluginCLAP* const instance = static_cast<PluginCLAP*>(plugin->plugin_data); | PluginCLAP* const instance = static_cast<PluginCLAP*>(plugin->plugin_data); | ||||
| return instance->flushParameters(in, out); | |||||
| return instance->flushParameters(in, out, 0); | |||||
| } | } | ||||
| static const clap_plugin_params_t clap_plugin_params = { | static const clap_plugin_params_t clap_plugin_params = { | ||||
| @@ -14,28 +14,6 @@ | |||||
| * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
| */ | */ | ||||
| #include "DistrhoPluginInternal.hpp" | |||||
| #include "../DistrhoPluginUtils.hpp" | |||||
| #include "../extra/ScopedPointer.hpp" | |||||
| #define DPF_VST3_MAX_BUFFER_SIZE 32768 | |||||
| #define DPF_VST3_MAX_SAMPLE_RATE 384000 | |||||
| #define DPF_VST3_MAX_LATENCY DPF_VST3_MAX_SAMPLE_RATE * 10 | |||||
| #if DISTRHO_PLUGIN_HAS_UI | |||||
| # include "../extra/RingBuffer.hpp" | |||||
| #endif | |||||
| #include "travesty/audio_processor.h" | |||||
| #include "travesty/component.h" | |||||
| #include "travesty/edit_controller.h" | |||||
| #include "travesty/factory.h" | |||||
| #include "travesty/host.h" | |||||
| #include <map> | |||||
| #include <string> | |||||
| #include <vector> | |||||
| /* TODO items: | /* TODO items: | ||||
| * == parameters | * == parameters | ||||
| * - test parameter triggers | * - test parameter triggers | ||||
| @@ -43,7 +21,6 @@ | |||||
| * - parameter groups via unit ids | * - parameter groups via unit ids | ||||
| * - test parameter changes from DSP (aka requestParameterValueChange) | * - test parameter changes from DSP (aka requestParameterValueChange) | ||||
| * - implement getParameterNormalized/setParameterNormalized for MIDI CC params ? | * - implement getParameterNormalized/setParameterNormalized for MIDI CC params ? | ||||
| * - fully implemented parameter stuff and verify | |||||
| * - float to int safe casting | * - float to int safe casting | ||||
| * - verify that latency changes works (with and without DPF_VST3_USES_SEPARATE_CONTROLLER) | * - verify that latency changes works (with and without DPF_VST3_USES_SEPARATE_CONTROLLER) | ||||
| * == MIDI | * == MIDI | ||||
| @@ -60,6 +37,28 @@ | |||||
| * - do something with set_io_mode? | * - do something with set_io_mode? | ||||
| */ | */ | ||||
| #include "DistrhoPluginInternal.hpp" | |||||
| #include "../DistrhoPluginUtils.hpp" | |||||
| #include "../extra/ScopedPointer.hpp" | |||||
| #define DPF_VST3_MAX_BUFFER_SIZE 32768 | |||||
| #define DPF_VST3_MAX_SAMPLE_RATE 384000 | |||||
| #define DPF_VST3_MAX_LATENCY DPF_VST3_MAX_SAMPLE_RATE * 10 | |||||
| #if DISTRHO_PLUGIN_HAS_UI | |||||
| # include "../extra/RingBuffer.hpp" | |||||
| #endif | |||||
| #include "travesty/audio_processor.h" | |||||
| #include "travesty/component.h" | |||||
| #include "travesty/edit_controller.h" | |||||
| #include "travesty/factory.h" | |||||
| #include "travesty/host.h" | |||||
| #include <map> | |||||
| #include <string> | |||||
| #include <vector> | |||||
| START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
| // -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||