Browse Source

Tweaked VST wrapper so that MIDI effect plug-ins work even if the user forgets to define JucePlugin_WantsMidiInput/Output

tags/2021-05-28
hogliux 9 years ago
parent
commit
6f4571b2e5
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp

+ 5
- 5
modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp View File

@@ -566,13 +566,13 @@ public:
host that we want midi. In the SDK this method is marked as deprecated, but
some hosts rely on this behaviour.
*/
if (vstEffect.flags & vstEffectFlagIsSynth || JucePlugin_WantsMidiInput)
if (vstEffect.flags & vstEffectFlagIsSynth || JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect)
{
if (hostCallback != nullptr)
hostCallback (&vstEffect, hostOpcodePlugInWantsMidi, 0, 1, 0, 0);
}
#if JucePlugin_ProducesMidiOutput
#if JucePlugin_ProducesMidiOutput || JucePlugin_IsMidiEffect
outgoingEvents.ensureSize (512);
#endif
}
@@ -1697,7 +1697,7 @@ private:
pointer_sized_int handlePreAudioProcessingEvents (VstOpCodeArguments args)
{
#if JucePlugin_WantsMidiInput
#if JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect
VSTMidiEventList::addEventsToMidiBuffer ((VstEventBlock*) args.ptr, midiEvents);
return 1;
#else
@@ -1859,7 +1859,7 @@ private:
|| strcmp (text, "receiveVstMidiEvent") == 0
|| strcmp (text, "receiveVstMidiEvents") == 0)
{
#if JucePlugin_WantsMidiInput
#if JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect
return 1;
#else
return -1;
@@ -1870,7 +1870,7 @@ private:
|| strcmp (text, "sendVstMidiEvent") == 0
|| strcmp (text, "sendVstMidiEvents") == 0)
{
#if JucePlugin_ProducesMidiOutput
#if JucePlugin_ProducesMidiOutput || JucePlugin_IsMidiEffect
return 1;
#else
return -1;


Loading…
Cancel
Save