From 3c5f09243a24f6e77e9f5a536fb7135d8aeac771 Mon Sep 17 00:00:00 2001 From: reuk Date: Sat, 10 Jul 2021 20:15:21 +0100 Subject: [PATCH] REAPER Demo: Check opcode index before running embedded UI commands The comment at the top of reaper_plugin_fx_embed.h specifies that the 'index' parameter for the embedded UI feature will always be set to effEditDraw. --- examples/Plugins/ReaperEmbeddedViewPluginDemo.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/Plugins/ReaperEmbeddedViewPluginDemo.h b/examples/Plugins/ReaperEmbeddedViewPluginDemo.h index d5c3882a6b..614f1bd914 100644 --- a/examples/Plugins/ReaperEmbeddedViewPluginDemo.h +++ b/examples/Plugins/ReaperEmbeddedViewPluginDemo.h @@ -67,6 +67,7 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wshadow-field-in-constructor", #include #include #include +#include JUCE_END_IGNORE_WARNINGS_GCC_LIKE @@ -274,11 +275,16 @@ public: return 0; } - pointer_sized_int handleVstManufacturerSpecific (int32, + pointer_sized_int handleVstManufacturerSpecific (int32 index, pointer_sized_int value, void* ptr, float opt) override { + // The docstring at the top of reaper_plugin_fx_embed.h specifies + // that the index will always be effEditDraw, which is now deprecated. + if (index != __effEditDrawDeprecated) + return 0; + return (pointer_sized_int) handledEmbeddedUIMessage ((int) opt, (Steinberg::TPtrInt) value, (Steinberg::TPtrInt) ptr);