Loading...
Searching...
No Matches
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>
16namespace Device
17{
18class ProtocolFactory;
20{
22 QString name;
23 QVariant deviceSpecificSettings;
24};
25
26inline 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
45using DeviceResource = ossia::variant<
47using DeviceResources = ossia::small_vector<DeviceResource, 2>;
48using DeviceResourceMap = ossia::flat_map<QString, DeviceResources>;
49}
50
51// See note in AddressSettings.hpp for Address / Device
52JSON_METADATA(Device::DeviceSettings, "Device")
53SCORE_SERIALIZE_DATASTREAM_DECLARE(SCORE_LIB_DEVICE_EXPORT, Device::DeviceSettings);
54
55Q_DECLARE_METATYPE(Device::DeviceSettings)
56W_REGISTER_ARGTYPE(Device::DeviceSettings)
Definition UuidKey.hpp:343
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