Loading...
Searching...
No Matches
Vst/Control.hpp
1#pragma once
2#include <Dataflow/PortItem.hpp>
3#include <Vst/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 vst
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 int fxNum{};
66
67 float value() const { return ossia::convert<float>(Process::ControlInlet::value()); }
68 void setValue(float v) { Process::ControlInlet::setValue(v); }
69};
70
72{
73public:
74 using Dataflow::AutomatablePortItem::AutomatablePortItem;
75
76 void setupMenu(QMenu& menu, const score::DocumentContext& ctx) override;
77 bool on_createAutomation(
78 const Scenario::IntervalModel& cst, std::function<void(score::Command*)> macro,
79 const score::DocumentContext& ctx) override;
80};
81
83{
84public:
85 ~ControlPortFactory() override;
86
87 UuidKey<Process::Port> concreteKey() const noexcept override;
88
89 Process::Port* load(const VisitorVariant& vis, QObject* parent) override;
90
91 Dataflow::PortItem* makePortItem(
92 Process::Inlet& port, const Process::Context& ctx, QGraphicsItem* parent,
93 QObject* context) override;
94
95 Dataflow::PortItem* makePortItem(
96 Process::Outlet& port, const Process::Context& ctx, QGraphicsItem* parent,
97 QObject* context) override;
98
99 void setupInletInspector(
100 const Process::Inlet& port, const score::DocumentContext& ctx, QWidget* parent,
101 Inspector::Layout& lay, QObject* context) override;
102};
103}
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 Vst/Control.hpp:19
Definition Vst/Control.hpp:83
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 Vst/Control.hpp:72