2#include <State/Address.hpp>
3#include <State/Domain.hpp>
4#include <State/Unit.hpp>
6#include <Device/Address/AddressSettings.hpp>
8#include <Process/Dataflow/PortForward.hpp>
9#include <Process/Dataflow/PortType.hpp>
11#include <score/model/IdentifiedObject.hpp>
12#include <score/model/path/Path.hpp>
13#include <score/plugins/SerializableInterface.hpp>
14#include <score/selection/Selectable.hpp>
15#include <score/serialization/VisitorInterface.hpp>
17#include <ossia/detail/small_vector.hpp>
18#include <ossia/network/value/value.hpp>
22#include <score_lib_process_export.h>
23#include <smallfun.hpp>
27#if __cpp_constexpr >= 201907
28#define VIRTUAL_CONSTEXPR constexpr
30#define VIRTUAL_CONSTEXPR
54 "8884228a-d197-4b0a-b6ca-d1fb15291559")
57 "34e2c5a7-18c4-4759-b6cc-46feaeee06e2")
60 "769dd38a-bfb3-4dc6-b52a-b6abb7afe2a3")
63 "cff96158-cc72-46d7-99dc-b6038171375b")
66 "c18adc77-e0e0-4ddf-a46c-43cb0719a890")
69 "d8a3ed3d-b9c2-46f2-bdb3-d282a48481c6")
72 "a1574bb0-cbd4-4c7d-9417-0c25cfd1187b")
75 "a1d97535-18ac-444a-8417-0cbc1692d897")
78 "9a13fb32-269a-47bf-99a9-930188c1f19c")
81 "3620ea94-5991-41cf-89b3-11f842cc39d0")
87static constexpr const qreal default_margin = 5.;
88static constexpr const qreal default_padding = 5.;
93 QPointF label{12., 0.};
94 QPointF control{0., 12.};
95 Qt::Alignment labelAlignment{};
96 Qt::Alignment controlAlignment{};
97 bool labelVisible{
true};
101class SCORE_LIB_PROCESS_EXPORT
Port
106 SCORE_SERIALIZE_FRIENDS
109 bool displayHandledExplicitly{};
110 bool noValueChangeOnMove{};
113 bool stableIdentity{};
119 const QString& visualName()
const noexcept;
120 const QString& visualDescription()
const noexcept;
122 const QString& name()
const noexcept;
124 const std::vector<Path<Cable>>& cables()
const noexcept;
125 const QString& exposed()
const noexcept;
126 const QString& description()
const noexcept;
135 virtual PortType type()
const noexcept = 0;
141 void setName(
const QString& customData);
143 void setExposed(
const QString& add);
145 void setDescription(
const QString& add);
146 W_SLOT(setDescription);
150 void nameChanged(
const QString& name)
151 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, nameChanged, name)
152 void exposedChanged(
const QString& addr)
153 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, exposedChanged, addr)
154 void descriptionChanged(
const QString& txt)
155 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, descriptionChanged, txt)
156 void cablesChanged() E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, cablesChanged)
158 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, addressChanged, address)
159 void executionReset() E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, executionReset)
163 address W_READ address W_WRITE setAddress W_NOTIFY addressChanged)
164 PROPERTY(QString, name W_READ name W_WRITE setName W_NOTIFY nameChanged)
165 PROPERTY(Process::PortType, type W_READ type W_CONSTANT W_FINAL)
167 virtual QByteArray saveData()
const noexcept;
169 virtual void loadData(
const QByteArray& arr, PortLoadDataFlags = {})
noexcept;
183 std::vector<Path<Cable>> m_cables;
186 QString m_description;
196 MODEL_METADATA_IMPL_HPP(
Inlet)
200 virtual void setupExecution(ossia::inlet&, QObject* exec_context)
const noexcept;
201 virtual void forChildInlets(
const smallfun::function<
void(
Inlet&)>&)
const noexcept;
202 virtual void mapExecution(
204 const smallfun::function<
void(
Inlet&, ossia::inlet&)>&)
const noexcept;
221 SCORE_SERIALIZE_FRIENDS
234 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
236 return Process::PortType::Message;
239 const ossia::value& value()
const noexcept {
return m_value; }
240 const ossia::value& init()
const noexcept {
return m_init; }
241 const State::Domain& domain()
const noexcept {
return m_domain; }
243 QByteArray saveData()
const noexcept override;
244 void loadData(
const QByteArray& arr, PortLoadDataFlags = {})
noexcept override;
247 void valueChanged(
const ossia::value& v)
248 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, valueChanged, v)
249 void initChanged(
const ossia::value& v)
250 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, initChanged, v)
251 void executionValueChanged(
const ossia::value& v)
252 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, executionValueChanged, v)
254 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, domainChanged, d)
257 virtual void setValue(
const ossia::value& value);
259 void setInit(
const ossia::value& value);
262 inline void setExecutionValue(
const ossia::value& value)
264 executionValueChanged(value);
290 PROPERTY(
State::Domain, domain W_READ domain W_WRITE setDomain W_NOTIFY domainChanged)
291 PROPERTY(ossia::value, value W_READ value W_WRITE setValue W_NOTIFY valueChanged)
292 PROPERTY(ossia::value, init W_READ init W_WRITE setInit W_NOTIFY initChanged)
294 ossia::value m_value;
303 SCORE_SERIALIZE_FRIENDS
306 MODEL_METADATA_IMPL_HPP(
Outlet)
309 virtual void setupExecution(ossia::outlet&, QObject* exec_context)
const noexcept;
310 virtual void forChildInlets(
const smallfun::function<
void(
Inlet&)>&)
const noexcept;
311 virtual void mapExecution(
313 const smallfun::function<
void(
Inlet&, ossia::inlet&)>&)
const noexcept;
330 SCORE_SERIALIZE_FRIENDS
343 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
345 return Process::PortType::Audio;
353 SCORE_SERIALIZE_FRIENDS
366 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
368 return Process::PortType::Audio;
371 void forChildInlets(
const smallfun::function<
void(
Inlet&)>&)
const noexcept override;
374 const smallfun::function<
void(
Inlet&, ossia::inlet&)>&)
const noexcept override;
376 QByteArray saveData()
const noexcept override;
377 void loadData(
const QByteArray& arr, PortLoadDataFlags = {})
noexcept override;
379 bool propagate()
const;
380 void setPropagate(
bool propagate);
381 void propagateChanged(
bool propagate)
382 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, propagateChanged, propagate)
385 void setGain(
double g);
386 void gainChanged(
double g) E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, gainChanged, g)
390 void panChanged(
pan_weight g) E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, panChanged, g)
392 std::unique_ptr<Process::ControlInlet> gainInlet;
393 std::unique_ptr<Process::ControlInlet> panInlet;
396 bool, propagate W_READ propagate W_WRITE setPropagate W_NOTIFY propagateChanged)
397 PROPERTY(
double, gain W_READ gain W_WRITE setGain W_NOTIFY gainChanged)
398 PROPERTY(
pan_weight, pan W_READ pan W_WRITE setPan W_NOTIFY panChanged)
402 bool m_propagate{
false};
409 SCORE_SERIALIZE_FRIENDS
422 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
424 return Process::PortType::Midi;
432 SCORE_SERIALIZE_FRIENDS
445 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
447 return Process::PortType::Midi;
455 SCORE_SERIALIZE_FRIENDS
468 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
470 return Process::PortType::Message;
473 QByteArray saveData()
const noexcept override;
474 void loadData(
const QByteArray& arr, PortLoadDataFlags = {})
noexcept override;
476 const ossia::value& value()
const {
return m_value; }
480 void valueChanged(
const ossia::value& v)
481 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, valueChanged, v)
482 void executionValueChanged(
const ossia::value& v)
483 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, executionValueChanged, v)
485 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, domainChanged, d)
488 void setExecutionValue(
const ossia::value& value) { executionValueChanged(value); }
490 void setValue(
const ossia::value& value)
510 PROPERTY(
State::Domain, domain W_READ domain W_WRITE setDomain W_NOTIFY domainChanged)
511 PROPERTY(ossia::value, value W_READ value W_WRITE setValue W_NOTIFY valueChanged)
513 ossia::value m_value;
521 SCORE_SERIALIZE_FRIENDS
534 QByteArray saveData()
const noexcept override;
535 void loadData(
const QByteArray& arr, PortLoadDataFlags = {})
noexcept override;
537 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
539 return Process::PortType::Message;
547 SCORE_SERIALIZE_FRIENDS
560 VIRTUAL_CONSTEXPR PortType type()
const noexcept override
562 return Process::PortType::Message;
571W_REGISTER_ARGTYPE(
Process::Port)
572W_REGISTER_ARGTYPE(
Process::Inlet)
573W_REGISTER_ARGTYPE(
Process::Outlet)
574W_REGISTER_ARGTYPE(
Process::ControlInlet)
575W_REGISTER_ARGTYPE(
Process::ControlOutlet)
576W_REGISTER_ARGTYPE(
Process::ValueInlet)
577W_REGISTER_ARGTYPE(
Process::ValueOutlet)
578W_REGISTER_ARGTYPE(
Process::MidiInlet)
579W_REGISTER_ARGTYPE(
Process::MidiOutlet)
580W_REGISTER_ARGTYPE(
Process::AudioInlet)
581W_REGISTER_ARGTYPE(
Process::AudioOutlet)
583W_REGISTER_ARGTYPE(
Process::Port*)
584W_REGISTER_ARGTYPE(
Process::Inlet*)
585W_REGISTER_ARGTYPE(
Process::Outlet*)
586W_REGISTER_ARGTYPE(
Process::ControlInlet*)
587W_REGISTER_ARGTYPE(
Process::ControlOutlet*)
588W_REGISTER_ARGTYPE(
Process::ValueInlet*)
589W_REGISTER_ARGTYPE(
Process::ValueOutlet*)
590W_REGISTER_ARGTYPE(
Process::MidiInlet*)
591W_REGISTER_ARGTYPE(
Process::MidiOutlet*)
592W_REGISTER_ARGTYPE(
Process::AudioInlet*)
593W_REGISTER_ARGTYPE(
Process::AudioOutlet*)
595W_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
void setDomainWithoutNotifying(const State::Domain &d) noexcept
Definition Port.hpp:286
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