DeviceSettings.hpp
1 #pragma once
2 #include <score/plugins/UuidKey.hpp>
3 #include <score/serialization/DataStreamFwd.hpp>
4 #include <score/tools/Metadata.hpp>
5 
6 #include <ossia/detail/flat_map.hpp>
7 #include <ossia/detail/small_vector.hpp>
8 #include <ossia/detail/variant.hpp>
9 
10 #include <QString>
11 #include <QVariant>
12 
13 #include <score_lib_device_export.h>
14 
15 #include <verdigris>
16 namespace Device
17 {
18 class ProtocolFactory;
20 {
22  QString name;
23  QVariant deviceSpecificSettings;
24 };
25 
26 inline bool operator==(const DeviceSettings& lhs, const DeviceSettings& rhs) noexcept
27 {
28  return lhs.protocol == rhs.protocol && lhs.name == rhs.name
29  && lhs.deviceSpecificSettings == rhs.deviceSpecificSettings;
30 }
31 
33 {
34  int port{};
35 };
37 {
38  int port{};
39 };
41 {
42  QString hardware;
43 };
44 
45 using DeviceResource = ossia::variant<
47 using DeviceResources = ossia::small_vector<DeviceResource, 2>;
48 using DeviceResourceMap = ossia::flat_map<QString, DeviceResources>;
49 }
50 
51 // See note in AddressSettings.hpp for Address / Device
52 JSON_METADATA(Device::DeviceSettings, "Device")
53 SCORE_SERIALIZE_DATASTREAM_DECLARE(SCORE_LIB_DEVICE_EXPORT, Device::DeviceSettings);
54 
55 Q_DECLARE_METATYPE(Device::DeviceSettings)
56 W_REGISTER_ARGTYPE(Device::DeviceSettings)
Manipulation of Devices from Qt.
Definition: AddressSettings.cpp:14
Definition: DeviceSettings.hpp:20
Definition: DeviceSettings.hpp:41
Definition: DeviceSettings.hpp:37
Definition: DeviceSettings.hpp:33