diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e717f51..3a0af4ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,7 @@ option(CLAP_WRAPPER_WINDOWS_SINGLE_FILE "Build a single fine (rather than folder project(clap-wrapper LANGUAGES C CXX - VERSION 0.7.1 + VERSION 0.7.2 DESCRIPTION "CLAP-as-X wrappers" ) set(CLAP_WRAPPER_VERSION "${CMAKE_PROJECT_VERSION}" CACHE STRING "Version of the wrapper project") diff --git a/include/clapwrapper/vst3.h b/include/clapwrapper/vst3.h index 6eb852af..d6b453fc 100644 --- a/include/clapwrapper/vst3.h +++ b/include/clapwrapper/vst3.h @@ -16,11 +16,10 @@ #endif // the factory extension -static const CLAP_CONSTEXPR char CLAP_PLUGIN_FACTORY_INFO_VST3[] = - "clap.plugin-factory-info-as-vst3.draft0"; +static const CLAP_CONSTEXPR char CLAP_PLUGIN_FACTORY_INFO_VST3[] = "clap.plugin-factory-info-as-vst3/0"; // the plugin extension -static const CLAP_CONSTEXPR char CLAP_PLUGIN_AS_VST3[] = "clap.plugin-info-as-vst3.draft0"; +static const CLAP_CONSTEXPR char CLAP_PLUGIN_AS_VST3[] = "clap.plugin-info-as-vst3/0"; typedef uint8_t array_of_16_bytes[16]; @@ -77,6 +76,8 @@ typedef uint8_t array_of_16_bytes[16]; all members are optional when set to nullptr if not provided, the wrapper code will use/generate appropriate values + + this struct is being returned by the plugin in clap_plugin_factory_as_vst3_t::get_vst3_info() */ typedef struct clap_plugin_info_as_vst3 @@ -92,7 +93,7 @@ typedef struct clap_plugin_info_as_vst3 all members are optional and can be set to nullptr if not provided, the wrapper code will use/generate appropriate values - retrieved when asking for factory CLAP_PLUGIN_FACTORY_INFO_VST3 + retrieved when asking for factory CLAP_PLUGIN_FACTORY_INFO_VST3 by clap_entry::get_factory() */ typedef struct clap_plugin_factory_as_vst3 @@ -125,6 +126,8 @@ enum clap_supported_note_expressions /* retrieve additional information for the plugin itself, if note expressions are being supported and if there is a limit in MIDI channels (to reduce the offered controllers etc. in the VST3 host) + + This extension is optionally returned by the plugin when asked for extension CLAP_PLUGIN_AS_VST3 */ typedef struct clap_plugin_as_vst3 { diff --git a/src/detail/vst3/parameter.h b/src/detail/vst3/parameter.h index bbb0e3d9..0b764187 100644 --- a/src/detail/vst3/parameter.h +++ b/src/detail/vst3/parameter.h @@ -52,11 +52,6 @@ class Vst3Parameter : public Steinberg::Vst::Parameter inline double asClapValue(double vst3value) const { - auto& info = this->getInfo(); - if (info.stepCount > 0) - { - return (vst3value * float(info.stepCount)) + min_value; - } return (vst3value * (max_value - min_value)) + min_value; } inline double asVst3Value(double clapvalue) const diff --git a/src/wrapasvst3.cpp b/src/wrapasvst3.cpp index e2f4fdec..5f3423d6 100644 --- a/src/wrapasvst3.cpp +++ b/src/wrapasvst3.cpp @@ -106,7 +106,12 @@ tresult PLUGIN_API ClapAsVst3::setActive(TBool state) tresult PLUGIN_API ClapAsVst3::process(Vst::ProcessData& data) { + if (!_active || !_processing) + { + return kNotInitialized; + } auto thisFn = _plugin->AlwaysAudioThread(); + this->_processAdapter->process(data); return kResultOk; } @@ -132,7 +137,7 @@ tresult PLUGIN_API ClapAsVst3::getState(IBStream* state) uint32 PLUGIN_API ClapAsVst3::getLatencySamples() { - if (_plugin->_ext._latency) + if (_plugin->_ext._latency && _active) { return _plugin->_ext._latency->get(_plugin->_plugin); } @@ -830,7 +835,9 @@ void ClapAsVst3::request_callback() void ClapAsVst3::restartPlugin() { - if (componentHandler) componentHandler->restartComponent(Vst::RestartFlags::kReloadComponent); + if (componentHandler) + componentHandler->restartComponent(Vst::RestartFlags::kIoChanged | + Vst::RestartFlags::kLatencyChanged); } void ClapAsVst3::onBeginEdit(clap_id id) @@ -949,6 +956,9 @@ void ClapAsVst3::onIdle() Clap::ProcessAdapter pa; pa.setupProcessing(_plugin->_plugin, _plugin->_ext._params, audioInputs, audioOutputs, 0, 0, 0, this->parameters, componentHandler, nullptr, false, false); + + auto thisFn = _plugin->AlwaysMainThread(); // just to pacify the clap-helper + pa.flush(); } }