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")
86 static constexpr
const qreal default_margin = 5.;
87 static constexpr
const qreal default_padding = 5.;
92 QPointF label{12., 0.};
93 QPointF control{0., 12.};
94 std::optional<Qt::Alignment> labelAlignment;
95 bool labelVisible{
true};
99 class SCORE_LIB_PROCESS_EXPORT
Port
104 SCORE_SERIALIZE_FRIENDS
113 const QString& visualName()
const noexcept;
114 const QString& visualDescription()
const noexcept;
116 const QString& name()
const noexcept;
118 const std::vector<Path<Cable>>& cables()
const noexcept;
119 const QString& exposed()
const noexcept;
120 const QString& description()
const noexcept;
122 virtual PortType type()
const noexcept = 0;
128 void setName(
const QString& customData);
130 void setExposed(
const QString& add);
132 void setDescription(
const QString& add);
133 W_SLOT(setDescription);
137 void nameChanged(
const QString& name)
138 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, nameChanged, name)
139 void exposedChanged(
const QString& addr)
140 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, exposedChanged, addr)
141 void descriptionChanged(
const QString& txt)
142 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, descriptionChanged, txt)
143 void cablesChanged() E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, cablesChanged)
145 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, addressChanged, address)
146 void executionReset() E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, executionReset)
150 address W_READ address W_WRITE setAddress W_NOTIFY addressChanged)
151 PROPERTY(QString, name W_READ name W_WRITE setName W_NOTIFY nameChanged)
153 virtual QByteArray saveData()
const noexcept;
154 virtual void loadData(
const QByteArray& arr) noexcept;
168 std::vector<Path<Cable>> m_cables;
171 QString m_description;
180 MODEL_METADATA_IMPL_HPP(
Inlet)
184 virtual void setupExecution(ossia::inlet&)
const noexcept;
185 virtual void forChildInlets(
const smallfun::function<
void(
Inlet&)>&)
const noexcept;
186 virtual void mapExecution(
188 const smallfun::function<
void(
Inlet&, ossia::inlet&)>&)
const noexcept;
205 SCORE_SERIALIZE_FRIENDS
218 VIRTUAL_CONSTEXPR PortType type()
const noexcept
override
220 return Process::PortType::Message;
223 const ossia::value& value()
const noexcept {
return m_value; }
224 const State::Domain& domain()
const noexcept {
return m_domain; }
226 QByteArray saveData()
const noexcept
override;
227 void loadData(
const QByteArray& arr) noexcept
override;
230 void valueChanged(
const ossia::value& v)
231 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, valueChanged, v)
232 void executionValueChanged(
const ossia::value& v)
233 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, executionValueChanged, v)
235 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, domainChanged, d)
238 void setValue(
const ossia::value& value);
241 inline void setExecutionValue(
const ossia::value& value)
243 executionValueChanged(value);
256 PROPERTY(
State::Domain, domain W_READ domain W_WRITE setDomain W_NOTIFY domainChanged)
257 PROPERTY(ossia::value, value W_READ value W_WRITE setValue W_NOTIFY valueChanged)
259 ossia::value m_value;
267 SCORE_SERIALIZE_FRIENDS
270 MODEL_METADATA_IMPL_HPP(
Outlet)
273 virtual void forChildInlets(
const smallfun::function<
void(
Inlet&)>&)
const noexcept;
274 virtual void mapExecution(
276 const smallfun::function<
void(
Inlet&, ossia::inlet&)>&)
const noexcept;
293 SCORE_SERIALIZE_FRIENDS
306 VIRTUAL_CONSTEXPR PortType type()
const noexcept
override
308 return Process::PortType::Audio;
316 SCORE_SERIALIZE_FRIENDS
329 VIRTUAL_CONSTEXPR PortType type()
const noexcept
override
331 return Process::PortType::Audio;
334 void forChildInlets(
const smallfun::function<
void(
Inlet&)>&)
const noexcept
override;
337 const smallfun::function<
void(
Inlet&, ossia::inlet&)>&)
const noexcept
override;
339 QByteArray saveData()
const noexcept
override;
340 void loadData(
const QByteArray& arr) noexcept
override;
342 bool propagate()
const;
343 void setPropagate(
bool propagate);
344 void propagateChanged(
bool propagate)
345 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, propagateChanged, propagate)
348 void setGain(
double g);
349 void gainChanged(
double g) E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, gainChanged, g)
353 void panChanged(
pan_weight g) E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, panChanged, g)
355 std::unique_ptr<Process::ControlInlet> gainInlet;
356 std::unique_ptr<Process::ControlInlet> panInlet;
359 bool, propagate W_READ propagate W_WRITE setPropagate W_NOTIFY propagateChanged)
360 PROPERTY(
double, gain W_READ gain W_WRITE setGain W_NOTIFY gainChanged)
361 PROPERTY(
pan_weight, pan W_READ pan W_WRITE setPan W_NOTIFY panChanged)
365 bool m_propagate{
false};
372 SCORE_SERIALIZE_FRIENDS
385 VIRTUAL_CONSTEXPR PortType type()
const noexcept
override
387 return Process::PortType::Midi;
395 SCORE_SERIALIZE_FRIENDS
408 VIRTUAL_CONSTEXPR PortType type()
const noexcept
override
410 return Process::PortType::Midi;
418 SCORE_SERIALIZE_FRIENDS
431 VIRTUAL_CONSTEXPR PortType type()
const noexcept
override
433 return Process::PortType::Message;
436 QByteArray saveData()
const noexcept
override;
437 void loadData(
const QByteArray& arr) noexcept
override;
439 const ossia::value& value()
const {
return m_value; }
443 void valueChanged(
const ossia::value& v)
444 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, valueChanged, v)
445 void executionValueChanged(
const ossia::value& v)
446 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, executionValueChanged, v)
448 E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, domainChanged, d)
451 void setExecutionValue(
const ossia::value& value) { executionValueChanged(value); }
453 void setValue(
const ossia::value& value)
473 PROPERTY(
State::Domain, domain W_READ domain W_WRITE setDomain W_NOTIFY domainChanged)
474 PROPERTY(ossia::value, value W_READ value W_WRITE setValue W_NOTIFY valueChanged)
476 ossia::value m_value;
484 SCORE_SERIALIZE_FRIENDS
497 VIRTUAL_CONSTEXPR PortType type()
const noexcept
override
499 return Process::PortType::Message;
507 SCORE_SERIALIZE_FRIENDS
520 VIRTUAL_CONSTEXPR PortType type()
const noexcept
override
522 return Process::PortType::Message;
526 SCORE_LIB_PROCESS_EXPORT
527 std::unique_ptr<Inlet> make_value_inlet(
const Id<Process::Port>& c, QObject* parent);
528 SCORE_LIB_PROCESS_EXPORT
529 std::unique_ptr<Outlet> make_value_outlet(
const Id<Process::Port>& c, QObject* parent);
531 SCORE_LIB_PROCESS_EXPORT
532 std::unique_ptr<MidiInlet> make_midi_inlet(
const Id<Process::Port>& c, QObject* parent);
533 SCORE_LIB_PROCESS_EXPORT
534 std::unique_ptr<MidiOutlet>
537 SCORE_LIB_PROCESS_EXPORT
538 std::unique_ptr<AudioInlet>
540 SCORE_LIB_PROCESS_EXPORT
541 std::unique_ptr<AudioOutlet>
549 W_REGISTER_ARGTYPE(
Process::Port)
552 W_REGISTER_ARGTYPE(
Process::pan_weight)
Definition: QmlObjects.hpp:285
Definition: QmlObjects.hpp:312
Definition: QmlObjects.hpp:109
Definition: DataStreamVisitor.hpp:202
The IdentifiedObject class.
Definition: IdentifiedObject.hpp:19
Definition: JSONVisitor.hpp:423
Definition: QmlObjects.hpp:343
Definition: QmlObjects.hpp:379
Definition: QmlObjects.hpp:46
Definition: score-lib-process/Process/Dataflow/Port.hpp:290
Definition: score-lib-process/Process/Dataflow/Port.hpp:313
Definition: score-lib-process/Process/Dataflow/Port.hpp:202
Definition: score-lib-process/Process/Dataflow/Port.hpp:415
Definition: score-lib-process/Process/Dataflow/Port.hpp:176
Definition: score-lib-process/Process/Dataflow/Port.hpp:369
Definition: score-lib-process/Process/Dataflow/Port.hpp:392
Definition: score-lib-process/Process/Dataflow/Port.hpp:264
Definition: score-lib-process/Process/Dataflow/Port.hpp:102
Definition: score-lib-process/Process/Dataflow/Port.hpp:481
Definition: score-lib-process/Process/Dataflow/Port.hpp:504
The Selectable class.
Definition: Selectable.hpp:14
Definition: QmlObjects.hpp:77
Definition: QmlObjects.hpp:255
The id_base_t class.
Definition: Identifier.hpp:57
Generic serialization method for abstract classes.
Definition: SerializableInterface.hpp:21
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Definition: AddressSettings.hpp:131
Definition: score-lib-process/Process/Dataflow/Port.hpp:90
Definition: PortForward.hpp:31
Definition: Address.hpp:108
Definition: Domain.hpp:17