2#include <Process/Dataflow/PortFactory.hpp>
3#include <Process/GenericProcessFactory.hpp>
4#include <Process/Process.hpp>
6#include <Control/DefaultEffectItem.hpp>
7#include <Effect/EffectFactory.hpp>
8#include <Vst/Loader.hpp>
10#include <score/tools/std/Invoke.hpp>
12#include <ossia/detail/hash_map.hpp>
21 , vst::Model,
"BE8E6BD3-75F2-4102-8895-8A4EB4EA545A",
"VST",
"VST",
22 Process::ProcessCategory::Other,
"Plugins",
"VST plug-in",
23 "VST is a trademark of Steinberg Media Technologies GmbH", {}, {}, {},
24 QUrl(
"https://ossia.io/score-docs/processes/audio-plugins.html#controlling-vst-parameters"),
25 Process::ProcessFlags::ExternalEffect)
27DESCRIPTION_METADATA(, vst::Model, "")
30#define VST_FIRST_CONTROL_INDEX(synth) ((synth) ? 2 : 1)
37 AEffectWrapper(AEffect* f) noexcept
42 auto getParameter(int32_t index)
const noexcept {
return fx->getParameter(fx, index); }
43 auto setParameter(int32_t index,
float p)
const noexcept
45 return fx->setParameter(fx, index, p);
49 int32_t opcode, int32_t index = 0, intptr_t value = 0,
void* ptr =
nullptr,
50 float opt = 0.0f) const noexcept
52 return fx->dispatcher(fx, opcode, index, value, ptr, opt);
63 SCORE_SERIALIZE_FRIENDS
67 MODEL_METADATA_IMPL(Model)
72 template <
typename Impl>
73 Model(Impl& vis, QObject* parent)
74 : ProcessModel{vis, parent}
75 , m_registration{*this}
81 QString prettyShortName() const noexcept
override
85 QString category() const noexcept
override
91 void setCreatingControls(
bool ok) override;
93 ControlInlet* getControl(const
Id<
Process::Port>& p) const;
94 QString effect() const noexcept override;
95 QString prettyName() const noexcept override;
96 bool hasExternalUI() const noexcept;
98 std::shared_ptr<AEffectWrapper> fx{};
100 ossia::hash_map<int, ControlInlet*> controls;
103 void removeControl(
int fxnum);
106 void on_addControl(
int idx,
float v);
107 W_SLOT(on_addControl);
108 void on_addControl_impl(ControlInlet* inl);
109 void on_controlChangedFromScore(
int num,
float newval);
111 void reloadControls();
112 void reloadPrograms();
115 int32_t opcode, int32_t index = 0, intptr_t value = 0,
void* ptr =
nullptr,
118 return fx->dispatch(opcode, index, value, ptr, opt);
120 std::atomic_bool needIdle{};
125 std::vector<
Process::Preset> builtinPresets() const noexcept override;
127 QString getString(AEffectOpcodes op,
int param);
128 void setControlName(
int fxnum, ControlInlet* ctrl);
135 std::
string m_backup_chunk;
136 ossia::float_vector m_backup_float_data;
137 std::vector<
std::pair<
std::
string,
int>> m_programs;
138 int32_t m_effectId{};
139 bool m_createControls{};
141 struct vst_context_handler
144 explicit vst_context_handler(Model& self);
145 ~vst_context_handler();
150AEffect* getPluginInstance(int32_t
id);
151intptr_t vst_host_callback(
152 AEffect* effect, int32_t opcode, int32_t index, intptr_t value,
void* ptr,
159QString EffectProcessFactory_T<vst::Model>::customConstructionData() const noexcept;
163EffectProcessFactory_T<vst::Model>::descriptor(QString d) const noexcept;
Definition EffectFactory.hpp:14
The Process class.
Definition score-lib-process/Process/Process.hpp:61
The id_base_t class.
Definition Identifier.hpp:57
Definition Vst/Control.hpp:19
Definition plugins/score-plugin-vst/Vst/commands.hpp:41
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1324
ProcessFlags
Various settings for processes.
Definition ProcessFlags.hpp:17
Definition TimeValue.hpp:21