Loading...
Searching...
No Matches
/Vst3/Control.hpp
1#pragma once
2#include <Dataflow/PortItem.hpp>
3#include <Vst3/EffectModel.hpp>
4
5#include <ossia/network/domain/domain.hpp>
6#include <ossia/network/domain/domain_functions.hpp>
7#include <ossia/network/value/value_conversion.hpp>
8
9#include <verdigris>
10
11namespace Process
12{
13struct Context;
14}
15namespace vst3
16{
17
19{
20 W_OBJECT(ControlInlet)
21 SCORE_SERIALIZE_FRIENDS
22public:
23 MODEL_METADATA_IMPL(ControlInlet)
24 ControlInlet(Id<Process::Port> c, QObject* parent)
25 : Process::ControlInlet{std::move(c), parent}
26 {
27 setDomain(ossia::make_domain(0.f, 1.f));
28 setInit(0.5);
29 }
30
31 ControlInlet(DataStream::Deserializer& vis, QObject* parent)
32 : Process::ControlInlet{vis, parent, true}
33 {
34 vis.writeTo(*this);
35 setDomain(ossia::make_domain(0.f, 1.f));
36 setInit(0.5);
37 }
38 ControlInlet(JSONObject::Deserializer& vis, QObject* parent)
39 : Process::ControlInlet{vis, parent, true}
40 {
41 vis.writeTo(*this);
42 setDomain(ossia::make_domain(0.f, 1.f));
43 setInit(0.5);
44 }
45 ControlInlet(DataStream::Deserializer&& vis, QObject* parent)
46 : Process::ControlInlet{vis, parent, true}
47 {
48 vis.writeTo(*this);
49 setDomain(ossia::make_domain(0.f, 1.f));
50 setInit(0.5);
51 }
52 ControlInlet(JSONObject::Deserializer&& vis, QObject* parent)
53 : Process::ControlInlet{vis, parent, true}
54 {
55 vis.writeTo(*this);
56 setDomain(ossia::make_domain(0.f, 1.f));
57 setInit(0.5);
58 }
59
60 VIRTUAL_CONSTEXPR Process::PortType type() const noexcept override
61 {
62 return Process::PortType::Message;
63 }
64
65 Steinberg::Vst::ParamID fxNum{};
66 float value() const { return ossia::convert<float>(Process::ControlInlet::value()); }
67 void setValue(float v) { Process::ControlInlet::setValue(v); }
68};
69
71{
72public:
73 using Dataflow::AutomatablePortItem::AutomatablePortItem;
74
75 void setupMenu(QMenu& menu, const score::DocumentContext& ctx) override;
76 bool on_createAutomation(
77 const Scenario::IntervalModel& cst, std::function<void(score::Command*)> macro,
78 const score::DocumentContext& ctx) override;
79};
80
82{
83public:
84 ~VSTControlPortFactory() override;
85
86 UuidKey<Process::Port> concreteKey() const noexcept override;
87
88 Process::Port* load(const VisitorVariant& vis, QObject* parent) override;
89
90 Dataflow::PortItem* makePortItem(
91 Process::Inlet& port, const Process::Context& ctx, QGraphicsItem* parent,
92 QObject* context) override;
93
94 Dataflow::PortItem* makePortItem(
95 Process::Outlet& port, const Process::Context& ctx, QGraphicsItem* parent,
96 QObject* context) override;
97
98 void setupInletInspector(
99 const Process::Inlet& port, const score::DocumentContext& ctx, QWidget* parent,
100 Inspector::Layout& lay, QObject* context) override;
101};
102}
Definition DataStreamVisitor.hpp:202
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:21
Definition score-lib-process/Process/Dataflow/PortItem.hpp:39
Definition lib/score/widgets/Layout.hpp:29
Definition JSONVisitor.hpp:423
Definition Port.hpp:203
Definition Port.hpp:177
Definition Port.hpp:273
Definition PortFactory.hpp:30
Definition Port.hpp:102
Definition IntervalModel.hpp:50
Definition UuidKey.hpp:343
The id_base_t class.
Definition Identifier.hpp:57
The Command class.
Definition Command.hpp:34
Definition /Vst3/Control.hpp:19
Definition /Vst3/Control.hpp:82
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1324
Definition ProcessContext.hpp:12
The VisitorVariant struct.
Definition VisitorInterface.hpp:26
Definition DocumentContext.hpp:18
Definition /Vst3/Control.hpp:71