Browse Source

VST3 Client: Work around broken editor resizing in Blue Cat's PatchWork

pull/22/head
reuk 3 years ago
parent
commit
f77b286b8c
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 29 additions and 3 deletions
  1. +29
    -3
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp

+ 29
- 3
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -642,10 +642,12 @@ class JuceVST3EditController : public Vst::EditController,
private ComponentRestarter::Listener
{
public:
JuceVST3EditController (Vst::IHostApplication* host)
explicit JuceVST3EditController (Vst::IHostApplication* host)
{
if (host != nullptr)
host->queryInterface (FUnknown::iid, (void**) &hostContext);
blueCatPatchwork |= isBlueCatHost (host);
}
//==============================================================================
@@ -675,6 +677,8 @@ public:
if (hostContext != context)
hostContext = context;
blueCatPatchwork |= isBlueCatHost (context);
return kResultTrue;
}
@@ -1284,6 +1288,27 @@ public:
static constexpr auto pluginShouldBeMarkedDirtyFlag = 1 << 16;
private:
bool isBlueCatHost (FUnknown* context) const
{
// We can't use the normal PluginHostType mechanism here because that will give us the name
// of the host process. However, this plugin instance might be loaded in an instance of
// the BlueCat PatchWork host, which might itself be a plugin.
VSTComSmartPtr<Vst::IHostApplication> host;
host.loadFrom (context);
if (host == nullptr)
return false;
Vst::String128 name;
if (host->getName (name) != kResultOk)
return false;
const auto hostName = toString (name);
return hostName.contains ("Blue Cat's VST3 Host");
}
friend class JuceVST3Component;
friend struct Param;
@@ -1359,6 +1384,7 @@ private:
inSetupProcessing { false };
int lastLatencySamples = 0;
bool blueCatPatchwork = isBlueCatHost (hostContext.get());
#if ! JUCE_MAC
float lastScaleFactorReceived = 1.0f;
@@ -2065,9 +2091,9 @@ private:
auto host = getHostType();
#if JUCE_MAC
if (host.isWavelab() || host.isReaper())
if (host.isWavelab() || host.isReaper() || owner.owner->blueCatPatchwork)
#else
if (host.isWavelab() || host.isAbletonLive() || host.isBitwigStudio())
if (host.isWavelab() || host.isAbletonLive() || host.isBitwigStudio() || owner.owner->blueCatPatchwork)
#endif
setBounds (editorBounds.withPosition (0, 0));
}


Loading…
Cancel
Save