SharedInputSettings.hpp
1 #pragma once
2 #include <Device/Protocol/DeviceInterface.hpp>
3 #include <Device/Protocol/DeviceSettings.hpp>
4 #include <Device/Protocol/ProtocolFactoryInterface.hpp>
5 #include <Device/Protocol/ProtocolSettingsWidget.hpp>
6 
7 #include <Gfx/SharedInputSettings.hpp>
8 
9 #include <QString>
10 
11 #include <score_plugin_gfx_export.h>
12 
13 #include <verdigris>
14 
15 class QFormLayout;
16 class QSpinBox;
17 class QLineEdit;
18 namespace Gfx
19 {
20 struct SCORE_PLUGIN_GFX_EXPORT SharedInputSettings
21 {
22  QString path;
23 };
24 
25 class SCORE_PLUGIN_GFX_EXPORT SharedInputProtocolFactory : public Device::ProtocolFactory
26 {
27 public:
29 
30  QString category() const noexcept override;
31 
32  Device::AddressDialog* makeAddAddressDialog(
33  const Device::DeviceInterface& dev, const score::DocumentContext& ctx,
34  QWidget* parent) override;
35  Device::AddressDialog* makeEditAddressDialog(
37  const score::DocumentContext& ctx, QWidget*) override;
38 
39  QVariant makeProtocolSpecificSettings(const VisitorVariant& visitor) const override;
40 
41  void serializeProtocolSpecificSettings(
42  const QVariant& data, const VisitorVariant& visitor) const override;
43 
44  bool checkCompatibility(
45  const Device::DeviceSettings& a,
46  const Device::DeviceSettings& b) const noexcept override;
47 };
48 
49 class SCORE_PLUGIN_GFX_EXPORT SharedInputSettingsWidget
51 {
52 public:
53  SharedInputSettingsWidget(QWidget* parent = nullptr);
54 
55  Device::DeviceSettings getSettings() const override;
56 
57  void setSettings(const Device::DeviceSettings& settings) override;
58 
59 protected:
60  Device::DeviceSettings m_settings;
61  QFormLayout* m_layout{};
62  QLineEdit* m_deviceNameEdit{};
63  QLineEdit* m_shmPath{};
64 };
65 
66 }
67 
68 SCORE_SERIALIZE_DATASTREAM_DECLARE(SCORE_PLUGIN_GFX_EXPORT, Gfx::SharedInputSettings);
69 Q_DECLARE_METATYPE(Gfx::SharedInputSettings)
70 W_REGISTER_ARGTYPE(Gfx::SharedInputSettings)
Definition: ProtocolSettingsWidget.hpp:41
Definition: DeviceInterface.hpp:66
Definition: ProtocolFactoryInterface.hpp:47
Definition: ProtocolSettingsWidget.hpp:22
Definition: SharedInputSettings.hpp:26
Definition: SharedInputSettings.hpp:51
Binds the rendering pipeline to ossia processes.
Definition: CameraDevice.cpp:28
Definition: AddressSettings.hpp:49
Definition: DeviceSettings.hpp:20
Definition: SharedInputSettings.hpp:21
The VisitorVariant struct.
Definition: VisitorInterface.hpp:26
Definition: DocumentContext.hpp:18