2#include <State/Address.hpp>
3#include <State/Domain.hpp>
5#include <Device/Address/AddressSettings.hpp>
7#include <Process/Dataflow/PortForward.hpp>
8#include <Process/Dataflow/PortType.hpp>
10#include <score/model/IdentifiedObject.hpp>
11#include <score/model/path/Path.hpp>
12#include <score/plugins/SerializableInterface.hpp>
13#include <score/selection/Selectable.hpp>
14#include <score/serialization/VisitorInterface.hpp>
16#include <ossia/detail/small_vector.hpp>
17#include <ossia/network/value/value.hpp>
21#include <score_lib_process_export.h>
22#include <smallfun.hpp>
26#if __cpp_constexpr >= 201907
27#define VIRTUAL_CONSTEXPR constexpr
29#define VIRTUAL_CONSTEXPR
53 "8884228a-d197-4b0a-b6ca-d1fb15291559")
56 "34e2c5a7-18c4-4759-b6cc-46feaeee06e2")
59 "769dd38a-bfb3-4dc6-b52a-b6abb7afe2a3")
62 "cff96158-cc72-46d7-99dc-b6038171375b")
65 "c18adc77-e0e0-4ddf-a46c-43cb0719a890")
68 "d8a3ed3d-b9c2-46f2-bdb3-d282a48481c6")
71 "a1574bb0-cbd4-4c7d-9417-0c25cfd1187b")
74 "a1d97535-18ac-444a-8417-0cbc1692d897")
77 "9a13fb32-269a-47bf-99a9-930188c1f19c")
80 "3620ea94-5991-41cf-89b3-11f842cc39d0")
86static constexpr const qreal default_margin = 5.;
87static constexpr const qreal default_padding = 5.;
92 QPointF label{12., 0.};
93 QPointF control{0., 12.};
94 Qt::Alignment labelAlignment{};
95 Qt::Alignment controlAlignment{};
96 bool labelVisible{
true};
100class SCORE_LIB_PROCESS_EXPORT
Port
105 SCORE_SERIALIZE_FRIENDS
108 bool displayHandledExplicitly{};
109 bool noValueChangeOnMove{};
115 const QString& visualName()
const noexcept;
116 const QString& visualDescription()
const noexcept;
118 const QString& name()
const noexcept;
120 const std::vector<Path<Cable>>& cables()
const noexcept;
121 const QString& exposed()
const noexcept;
122 const QString& description()
const noexcept;
124 virtual PortType type()
const noexcept = 0;
130 void setName(
const QString& customData);
132 void setExposed(
const QString& add);
134 void setDescription(
const QString& add);
135 W_SLOT(setDescription);
139 void nameChanged(
const QString& name)
140 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, nameChanged, name)
141 void exposedChanged(
const QString& addr)
142 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, exposedChanged, addr)
143 void descriptionChanged(
const QString& txt)
144 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, descriptionChanged, txt)
145 void cablesChanged() E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, cablesChanged)
147 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, addressChanged, address)
148 void executionReset() E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, executionReset)
152 address W_READ address W_WRITE setAddress W_NOTIFY addressChanged)
153 PROPERTY(QString, name W_READ name W_WRITE setName W_NOTIFY nameChanged)
154 PROPERTY(Process::PortType, type W_READ type W_CONSTANT W_FINAL)
156 virtual QByteArray saveData()
const noexcept;
158 virtual void loadData(
const QByteArray& arr, PortLoadDataFlags = {})
noexcept;
172 std::vector<Path<Cable>> m_cables;
175 QString m_description;
184 MODEL_METADATA_IMPL_HPP(
Inlet)
188 virtual void setupExecution(ossia::inlet&, QObject* exec_context)
const noexcept;
189 virtual void forChildInlets(
const smallfun::function<
void(
Inlet&)>&)
const noexcept;
190 virtual void mapExecution(
192 const smallfun::function<
void(
Inlet&, ossia::inlet&)>&)
const noexcept;
209 SCORE_SERIALIZE_FRIENDS
222 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
224 return Process::PortType::Message;
227 const ossia::value& value()
const noexcept {
return m_value; }
228 const ossia::value& init()
const noexcept {
return m_init; }
229 const State::Domain& domain()
const noexcept {
return m_domain; }
231 QByteArray saveData()
const noexcept override;
232 void loadData(
const QByteArray& arr, PortLoadDataFlags = {})
noexcept override;
235 void valueChanged(
const ossia::value& v)
236 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, valueChanged, v)
237 void initChanged(
const ossia::value& v)
238 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, initChanged, v)
239 void executionValueChanged(
const ossia::value& v)
240 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, executionValueChanged, v)
242 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, domainChanged, d)
245 void setValue(
const ossia::value& value);
247 void setInit(
const ossia::value& value);
250 inline void setExecutionValue(
const ossia::value& value)
252 executionValueChanged(value);
265 PROPERTY(
State::Domain, domain W_READ domain W_WRITE setDomain W_NOTIFY domainChanged)
266 PROPERTY(ossia::value, value W_READ value W_WRITE setValue W_NOTIFY valueChanged)
267 PROPERTY(ossia::value, init W_READ init W_WRITE setInit W_NOTIFY initChanged)
269 ossia::value m_value;
278 SCORE_SERIALIZE_FRIENDS
281 MODEL_METADATA_IMPL_HPP(
Outlet)
284 virtual void setupExecution(ossia::outlet&, QObject* exec_context)
const noexcept;
285 virtual void forChildInlets(
const smallfun::function<
void(
Inlet&)>&)
const noexcept;
286 virtual void mapExecution(
288 const smallfun::function<
void(
Inlet&, ossia::inlet&)>&)
const noexcept;
305 SCORE_SERIALIZE_FRIENDS
318 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
320 return Process::PortType::Audio;
328 SCORE_SERIALIZE_FRIENDS
341 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
343 return Process::PortType::Audio;
346 void forChildInlets(
const smallfun::function<
void(
Inlet&)>&)
const noexcept override;
349 const smallfun::function<
void(
Inlet&, ossia::inlet&)>&)
const noexcept override;
351 QByteArray saveData()
const noexcept override;
352 void loadData(
const QByteArray& arr, PortLoadDataFlags = {})
noexcept override;
354 bool propagate()
const;
355 void setPropagate(
bool propagate);
356 void propagateChanged(
bool propagate)
357 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, propagateChanged, propagate)
360 void setGain(
double g);
361 void gainChanged(
double g) E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, gainChanged, g)
365 void panChanged(
pan_weight g) E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, panChanged, g)
367 std::unique_ptr<Process::ControlInlet> gainInlet;
368 std::unique_ptr<Process::ControlInlet> panInlet;
371 bool, propagate W_READ propagate W_WRITE setPropagate W_NOTIFY propagateChanged)
372 PROPERTY(
double, gain W_READ gain W_WRITE setGain W_NOTIFY gainChanged)
373 PROPERTY(
pan_weight, pan W_READ pan W_WRITE setPan W_NOTIFY panChanged)
377 bool m_propagate{
false};
384 SCORE_SERIALIZE_FRIENDS
397 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
399 return Process::PortType::Midi;
407 SCORE_SERIALIZE_FRIENDS
420 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
422 return Process::PortType::Midi;
430 SCORE_SERIALIZE_FRIENDS
443 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
445 return Process::PortType::Message;
448 QByteArray saveData()
const noexcept override;
449 void loadData(
const QByteArray& arr, PortLoadDataFlags = {})
noexcept override;
451 const ossia::value& value()
const {
return m_value; }
455 void valueChanged(
const ossia::value& v)
456 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, valueChanged, v)
457 void executionValueChanged(
const ossia::value& v)
458 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, executionValueChanged, v)
460 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, domainChanged, d)
463 void setExecutionValue(
const ossia::value& value) { executionValueChanged(value); }
465 void setValue(
const ossia::value& value)
485 PROPERTY(
State::Domain, domain W_READ domain W_WRITE setDomain W_NOTIFY domainChanged)
486 PROPERTY(ossia::value, value W_READ value W_WRITE setValue W_NOTIFY valueChanged)
488 ossia::value m_value;
496 SCORE_SERIALIZE_FRIENDS
509 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
511 return Process::PortType::Message;
519 SCORE_SERIALIZE_FRIENDS
532 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
534 return Process::PortType::Message;
543W_REGISTER_ARGTYPE(
Process::Port)
544W_REGISTER_ARGTYPE(
Process::Inlet)
545W_REGISTER_ARGTYPE(
Process::Outlet)
546W_REGISTER_ARGTYPE(
Process::ControlInlet)
547W_REGISTER_ARGTYPE(
Process::ControlOutlet)
548W_REGISTER_ARGTYPE(
Process::ValueInlet)
549W_REGISTER_ARGTYPE(
Process::ValueOutlet)
550W_REGISTER_ARGTYPE(
Process::MidiInlet)
551W_REGISTER_ARGTYPE(
Process::MidiOutlet)
552W_REGISTER_ARGTYPE(
Process::AudioInlet)
553W_REGISTER_ARGTYPE(
Process::AudioOutlet)
555W_REGISTER_ARGTYPE(
Process::Port*)
556W_REGISTER_ARGTYPE(
Process::Inlet*)
557W_REGISTER_ARGTYPE(
Process::Outlet*)
558W_REGISTER_ARGTYPE(
Process::ControlInlet*)
559W_REGISTER_ARGTYPE(
Process::ControlOutlet*)
560W_REGISTER_ARGTYPE(
Process::ValueInlet*)
561W_REGISTER_ARGTYPE(
Process::ValueOutlet*)
562W_REGISTER_ARGTYPE(
Process::MidiInlet*)
563W_REGISTER_ARGTYPE(
Process::MidiOutlet*)
564W_REGISTER_ARGTYPE(
Process::AudioInlet*)
565W_REGISTER_ARGTYPE(
Process::AudioOutlet*)
567W_REGISTER_ARGTYPE(
Process::pan_weight)
Definition DataStreamVisitor.hpp:202
The IdentifiedObject class.
Definition IdentifiedObject.hpp:19
Definition JSONVisitor.hpp:423
The Path class is a typesafe wrapper around ObjectPath.
Definition Path.hpp:52
The Selectable class.
Definition Selectable.hpp:14
The id_base_t class.
Definition Identifier.hpp:59
Generic serialization method for abstract classes.
Definition SerializableInterface.hpp:21
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1115
Definition AddressSettings.hpp:131
Definition PortForward.hpp:31
Definition Address.hpp:108