From 549306b295d812fc84c2f6c4b2b8d82c64580123 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 21 May 2021 02:03:27 +0200 Subject: [PATCH] Include effString2Parameter in opcode list We don't need any special handling for this since our default argument detection will handle strings, but it might be useful for log output if a host ever uses this. At the moment there don't seem to be any hosts on Linux that use this. --- src/common/logging/vst2.cpp | 18 +++++++++++------- src/common/vst24.h | 8 ++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/common/logging/vst2.cpp b/src/common/logging/vst2.cpp index a188b80d..000c51e7 100644 --- a/src/common/logging/vst2.cpp +++ b/src/common/logging/vst2.cpp @@ -156,6 +156,9 @@ std::optional opcode_to_string(bool is_dispatch, int opcode) { case effGetSpeakerArrangement: return "effGetSpeakerArrangement"; break; + case effString2Parameter: + return "effString2Parameter"; + break; case effVendorSpecific: return "effVendorSpecific"; break; @@ -356,13 +359,14 @@ void Vst2Logger::log_set_parameter_response() { } } -void Vst2Logger::log_event(bool is_dispatch, - int opcode, - int index, - intptr_t value, - const Vst2Event::Payload& payload, - float option, - const std::optional& value_payload) { +void Vst2Logger::log_event( + bool is_dispatch, + int opcode, + int index, + intptr_t value, + const Vst2Event::Payload& payload, + float option, + const std::optional& value_payload) { if (BOOST_UNLIKELY(logger.verbosity >= Logger::Verbosity::most_events)) { if (should_filter_event(is_dispatch, opcode)) { return; diff --git a/src/common/vst24.h b/src/common/vst24.h index a17f86f8..97346be3 100644 --- a/src/common/vst24.h +++ b/src/common/vst24.h @@ -55,6 +55,14 @@ */ [[maybe_unused]] constexpr int effVendorSpecific = 50; +/** + * Set a parameter based on a string, kind of the inverse of the inverse of + * `effGetParamDisplay()` and an alternative to `setParameter()`. Also found in + * the list in Carla's repo. It's used in this way in JUCE here: + * https://github.com/juce-framework/JUCE/blob/b34e798f392179caf9c67dce273398fa03352067/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp#L927 + */ +[[maybe_unused]] constexpr int effString2Parameter = 27; + /** * Used by hosts to query the length of reverb tails (equivalent to * `IAudioProcessor::getTailSamples`). Found on the same list as above.