From 6ed49ff74ff563ed7b88eceb9101d4e33714a441 Mon Sep 17 00:00:00 2001 From: reuk Date: Sun, 26 Apr 2020 14:25:38 +0100 Subject: [PATCH] VST3: Fix issue where MIDI Logger example VST3 refused to load in Live --- examples/Plugins/MidiLoggerPluginDemo.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/Plugins/MidiLoggerPluginDemo.h b/examples/Plugins/MidiLoggerPluginDemo.h index 7a8508f923..89db564e4d 100644 --- a/examples/Plugins/MidiLoggerPluginDemo.h +++ b/examples/Plugins/MidiLoggerPluginDemo.h @@ -219,7 +219,7 @@ class MidiLoggerPluginDemoProcessor : public AudioProcessor, { public: MidiLoggerPluginDemoProcessor() - : AudioProcessor (BusesProperties()) + : AudioProcessor (getBusesLayout()) { state.addChild ({ "uiState", { { "width", 500 }, { "height", 300 } }, {} }, -1, nullptr); startTimerHz (60); @@ -329,6 +329,13 @@ private: queue.push (midi); } + static BusesProperties getBusesLayout() + { + // Live doesn't like to load midi-only plugins, so we add an audio output there. + return PluginHostType().isAbletonLive() ? BusesProperties().withOutput ("out", AudioChannelSet::stereo()) + : BusesProperties(); + } + ValueTree state { "state" }; MidiQueue queue; MidiListModel model; // The data to show in the UI. We keep it around in the processor so that