2 #include <Vst3/Commands.hpp>
3 #include <Vst3/Control.hpp>
4 #include <Vst3/EffectModel.hpp>
8 #include <pluginterfaces/vst/ivstcomponent.h>
9 #include <pluginterfaces/vst/ivsteditcontroller.h>
15 :
virtual public Steinberg::Vst::IComponentHandler
16 ,
virtual public Steinberg::Vst::IComponentHandler2
28 Steinberg::tresult queryInterface(
const Steinberg::TUID _iid,
void** obj)
override
30 using namespace Steinberg;
31 if(FUID::fromTUID(_iid) == Steinberg::Vst::IComponentHandler2::iid)
33 *obj =
static_cast<Steinberg::Vst::IComponentHandler2*
>(
this);
39 Steinberg::uint32 addRef()
override {
return 1; }
40 Steinberg::uint32 release()
override {
return 1; }
42 Steinberg::tresult beginEdit(Steinberg::Vst::ParamID
id)
override
45 if(
auto ctrl = m_model.controls.find(
id); ctrl == m_model.controls.end())
47 ossia::qt::run_async(&m_model, [&proc = m_model,
id] {
48 if(
auto ctrl = proc.controls.find(
id); ctrl == proc.controls.end())
50 auto& ctx = score::IDocument::documentContext(proc);
51 CommandDispatcher<>{ctx.commandStack}.submit<
CreateControl>(proc,
id);
55 return Steinberg::kResultOk;
58 Steinberg::tresult performEdit(
59 Steinberg::Vst::ParamID
id, Steinberg::Vst::ParamValue valueNormalized)
override
61 if(
auto ctrl = m_model.controls.find(
id); ctrl != m_model.controls.end())
63 ctrl->second->setValue(valueNormalized);
65 return Steinberg::kResultOk;
68 Steinberg::tresult endEdit(Steinberg::Vst::ParamID
id)
override
70 return Steinberg::kResultOk;
73 Steinberg::tresult restartComponent(Steinberg::int32 flags)
override
75 return m_model.restartComponent(flags);
78 Steinberg::tresult setDirty(Steinberg::TBool state)
override
80 return Steinberg::kResultOk;
83 Steinberg::tresult requestOpenEditor(Steinberg::FIDString name)
override
85 Process::setupExternalUI(m_model, score::IDocument::documentContext(m_model),
true);
86 return Steinberg::kResultOk;
89 Steinberg::tresult startGroupEdit()
override {
return Steinberg::kResultOk; }
91 Steinberg::tresult finishGroupEdit()
override {
return Steinberg::kResultOk; }
Definition: EditHandler.hpp:17
Definition: plugins/score-plugin-vst3/Vst3/commands.hpp:41
Definition: score-plugin-vst3/Vst3/EffectModel.hpp:41