19class PortConnection final :
public QObject,
public ICloneable<PortConnection>
25 using PortUuid = dsp::PortIdentifier::PortUuid;
27 PortConnection (QObject * parent =
nullptr);
35 QObject * parent =
nullptr);
41 void update (
float multiplier,
bool locked,
bool enabled)
49 static constexpr std::string_view kSourceIdKey =
"srcId";
50 static constexpr std::string_view kDestIdKey =
"destId";
51 static constexpr std::string_view kMultiplierKey =
"multiplier";
52 static constexpr std::string_view kLockedKey =
"locked";
53 static constexpr std::string_view kEnabledKey =
"enabled";
55 static constexpr std::string_view kBaseValueKey =
"baseValue";
56 friend void to_json (nlohmann::json &j,
const PortConnection &port_connection)
58 j[kSourceIdKey] = port_connection.src_id_;
59 j[kDestIdKey] = port_connection.dest_id_;
61 j[kLockedKey] = port_connection.
locked_;
62 j[kEnabledKey] = port_connection.
enabled_;
66 from_json (
const nlohmann::json &j, PortConnection &port_connection)
68 j.at (kSourceIdKey).get_to (port_connection.src_id_);
69 j.at (kDestIdKey).get_to (port_connection.dest_id_);
70 j.at (kMultiplierKey).get_to (port_connection.
multiplier_);
71 j.at (kLockedKey).get_to (port_connection.
locked_);
72 j.at (kEnabledKey).get_to (port_connection.
enabled_);
73 j.at (kBaseValueKey).get_to (port_connection.
base_value_);