fix(drop): recognize TCP/MCP FX-button hotspot for instrument drop (S-VIEW-BUG-1)
The FX-hotspot classifier matched only fx_ (the FX-chain/floating windows), so a drop on a track TCP FX button (info tcp*) never armed the drop and the capture fell through to arrange as audio. Widen to fx_/tcp/mcp in a pure, unit-tested predicate; shell calls it.
This commit is contained in:
@@ -5,10 +5,10 @@
|
||||
|
||||
#include "instrument_drop_win.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
#include "app_version.h" // vstPluginName() — the CHANNEL-correct FX name (stable/beta pairing)
|
||||
#include "app_version.h" // vstPluginName() — the CHANNEL-correct FX name (stable/beta pairing)
|
||||
#include "instrument_drop.h" // infoNamesFxHotspot — the PURE, unit-tested hotspot classifier
|
||||
|
||||
#include "reaper_plugin.h"
|
||||
|
||||
@@ -23,19 +23,6 @@
|
||||
|
||||
namespace reasampler {
|
||||
|
||||
namespace {
|
||||
|
||||
// GetThingFromPoint's info string prefixes (verified against reaper_plugin_functions.h:
|
||||
// "Updates infoOut with information such as 'arrange', 'fx_chain', 'fx_0' ... If a track
|
||||
// panel is hit, string will begin with 'tcp' or 'mcp' or 'tcp.mute' etc"). The FX region
|
||||
// reports "fx_chain" (the FX list area) or "fx_N" (a specific FX button). We treat either
|
||||
// as the FX hotspot — the S17 drop target.
|
||||
bool infoNamesFxHotspot(const char* info) {
|
||||
return std::strncmp(info, "fx_", 3) == 0;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
FxDropTarget resolveFxDropTarget(int screenX, int screenY) {
|
||||
FxDropTarget out;
|
||||
char info[256] = {0};
|
||||
@@ -46,6 +33,8 @@ FxDropTarget resolveFxDropTarget(int screenX, int screenY) {
|
||||
MediaTrack* track = GetThingFromPoint(screenX, screenY, info, sizeof(info));
|
||||
out.track = track;
|
||||
out.overReaperUi = (track != nullptr) || (info[0] != '\0');
|
||||
// S-VIEW-BUG-1: the hotspot is either the FX chain/floating window ("fx_*") OR the track/
|
||||
// mixer panel that hosts the FX button ("tcp*"/"mcp*"). The pure classifier owns the rule.
|
||||
out.overFxHotspot = (track != nullptr) && infoNamesFxHotspot(info);
|
||||
return out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user