Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.7.3 #233

Closed
wants to merge 3 commits into from
Closed

0.7.3 #233

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.3
DESCRIPTION "CLAP-as-X wrappers"
)
set(CLAP_WRAPPER_VERSION "${CMAKE_PROJECT_VERSION}" CACHE STRING "Version of the wrapper project")
Expand Down
11 changes: 7 additions & 4 deletions include/clapwrapper/vst3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
{
Expand Down
5 changes: 0 additions & 5 deletions src/detail/vst3/parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions src/wrapasvst3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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();
}
}
Expand Down
Loading