4#include <ossia/detail/flat_map.hpp>
8#include <pluginterfaces/base/funknown.h>
9#include <pluginterfaces/gui/iplugview.h>
10#include <pluginterfaces/vst/ivstaudioprocessor.h>
11#include <pluginterfaces/vst/ivstcomponent.h>
12#include <pluginterfaces/vst/ivstunits.h>
16#include <public.sdk/source/vst/hosting/hostclasses.h>
17#include <public.sdk/source/vst/hosting/module.h>
18#include <public.sdk/source/vst/hosting/plugprovider.h>
22class ApplicationPlugin;
25inline QString fromString(
const Steinberg::Vst::String128& str)
28 return [] <
typename T>(
const T& str) {
29 using char_type = std::decay_t<
decltype(str[0])>;
30 if constexpr(std::is_same_v<char_type, char16_t>)
31 return QString::fromUtf16(str);
33 return QString::fromWCharArray(str);
36 return QString::fromUtf16(str);
40using MIDIControls = ossia::flat_map<std::pair<int, int>, Steinberg::Vst::ParamID>;
54 const VST3::UID& uid,
double sr,
int max_bs);
55 operator bool()
const noexcept {
return component && processor; }
58 VST3::Hosting::Module::Ptr mdl;
59 Steinberg::Vst::IComponent* component{};
60 Steinberg::Vst::IAudioProcessor* processor{};
61 Steinberg::Vst::IEditController* controller{};
62 Steinberg::Vst::IUnitInfo* units{};
63 Steinberg::IPlugView* view{};
64 PlugFrame* plugFrame{};
71 void loadProcessorStateToController();
73 void start(
double sample_rate,
int max_bs);
76 bool supportsDouble{};
83 MIDIControls midiControls{};
85 Steinberg::Vst::ProgramListInfo programs;
88#if __cpp_concepts >= 201907
90concept BusVisitor =
requires(T&& vis)
92 vis.audioIn(Steinberg::Vst::BusInfo{},
int{});
93 vis.audioOut(Steinberg::Vst::BusInfo{},
int{});
94 vis.eventIn(Steinberg::Vst::BusInfo{},
int{});
95 vis.eventOut(Steinberg::Vst::BusInfo{},
int{});
97void forEachBus(BusVisitor
auto&& visitor, Steinberg::Vst::IComponent& component)
100void forEachBus(T&& visitor, Steinberg::Vst::IComponent& component)
104 =
component.getBusCount(Steinberg::Vst::kAudio, Steinberg::Vst::kInput);
106 =
component.getBusCount(Steinberg::Vst::kEvent, Steinberg::Vst::kInput);
108 =
component.getBusCount(Steinberg::Vst::kAudio, Steinberg::Vst::kOutput);
110 =
component.getBusCount(Steinberg::Vst::kEvent, Steinberg::Vst::kOutput);
112 Steinberg::Vst::BusInfo bus;
113 for(
int i = 0; i < audio_ins; i++)
115 component.getBusInfo(Steinberg::Vst::kAudio, Steinberg::Vst::kInput, i, bus);
116 visitor.audioIn(bus, i);
119 for(
int i = 0; i < event_ins; i++)
121 component.getBusInfo(Steinberg::Vst::kEvent, Steinberg::Vst::kInput, i, bus);
122 visitor.eventIn(bus, i);
125 for(
int i = 0; i < audio_outs; i++)
127 component.getBusInfo(Steinberg::Vst::kAudio, Steinberg::Vst::kOutput, i, bus);
128 visitor.audioOut(bus, i);
131 for(
int i = 0; i < event_outs; i++)
133 component.getBusInfo(Steinberg::Vst::kEvent, Steinberg::Vst::kOutput, i, bus);
134 visitor.eventOut(bus, i);
Definition score-plugin-vst3/Vst3/ApplicationPlugin.hpp:87
Definition score-plugin-vst3/Vst3/EffectModel.hpp:43
T & component(const score::Components &c)
component Fetch a Component from Components by type
Definition ComponentUtils.hpp:20