18class PortConnection :
public QObject
24 PortConnection (QObject * parent =
nullptr);
32 QObject * parent =
nullptr);
34 void update (
float multiplier,
bool locked,
bool enabled)
41 void set_bipolar (
bool bipolar) {
bipolar_ = bipolar; }
43 void set_channel_mapping (uint8_t source_channel, uint8_t destination_channel)
46 std::make_pair (source_channel, destination_channel);
48 void unset_channel_mapping ()
54 static constexpr std::string_view kSourceIdKey =
"srcId";
55 static constexpr std::string_view kDestIdKey =
"destId";
56 static constexpr std::string_view kMultiplierKey =
"multiplier";
57 static constexpr std::string_view kLockedKey =
"locked";
58 static constexpr std::string_view kEnabledKey =
"enabled";
59 static constexpr std::string_view kBipolarKey =
"bipolar";
60 static constexpr std::string_view kSourceDestMappingKey =
61 "sourceChannelToDestinationChannelMapping";
63 to_json (nlohmann::json &j,
const PortConnection &port_connection);
65 from_json (
const nlohmann::json &j, PortConnection &port_connection);
67 friend void init_from (
69 const PortConnection &other,
72 friend bool operator== (
const PortConnection &lhs,
const PortConnection &rhs)
74 return lhs.src_id_ == rhs.src_id_ && lhs.dest_id_ == rhs.dest_id_;
125 BOOST_DESCRIBE_CLASS (