SharedOutputSettings.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 <QString>
8 
9 #include <score_plugin_gfx_export.h>
10 
11 #include <verdigris>
12 
13 class QFormLayout;
14 class QSpinBox;
15 class QLineEdit;
16 namespace Gfx
17 {
18 struct SCORE_PLUGIN_GFX_EXPORT SharedOutputSettings
19 {
20  QString path;
21  int width{};
22  int height{};
23  double rate{};
24 };
25 
26 class SCORE_PLUGIN_GFX_EXPORT SharedOutputProtocolFactory
28 {
29 public:
31  Device::AddressDialog* makeAddAddressDialog(
32  const Device::DeviceInterface& dev, const score::DocumentContext& ctx,
33  QWidget* parent) override;
34  Device::AddressDialog* makeEditAddressDialog(
36  const score::DocumentContext& ctx, QWidget*) override;
37 
38  QVariant makeProtocolSpecificSettings(const VisitorVariant& visitor) const override;
39 
40  void serializeProtocolSpecificSettings(
41  const QVariant& data, const VisitorVariant& visitor) const override;
42 
43  bool checkCompatibility(
44  const Device::DeviceSettings& a,
45  const Device::DeviceSettings& b) const noexcept override;
46 
47  QString category() const noexcept override;
48 };
49 
50 class SCORE_PLUGIN_GFX_EXPORT SharedOutputSettingsWidget
52 {
53 public:
54  SharedOutputSettingsWidget(QWidget* parent = nullptr);
55 
56  Device::DeviceSettings getSettings() const override;
57 
58  void setSettings(const Device::DeviceSettings& settings) override;
59 
60 protected:
61  QFormLayout* m_layout{};
62  QLineEdit* m_deviceNameEdit{};
63  QLineEdit* m_shmPath{};
64  QSpinBox* m_width{};
65  QSpinBox* m_height{};
66  QSpinBox* m_rate{};
67 };
68 
69 }
70 
71 SCORE_SERIALIZE_DATASTREAM_DECLARE(SCORE_PLUGIN_GFX_EXPORT, Gfx::SharedOutputSettings);
72 Q_DECLARE_METATYPE(Gfx::SharedOutputSettings)
73 W_REGISTER_ARGTYPE(Gfx::SharedOutputSettings)
Definition: ProtocolSettingsWidget.hpp:41
Definition: DeviceInterface.hpp:66
Definition: ProtocolFactoryInterface.hpp:47
Definition: ProtocolSettingsWidget.hpp:22
Definition: SharedOutputSettings.hpp:28
Definition: SharedOutputSettings.hpp:52
Binds the rendering pipeline to ossia processes.
Definition: CameraDevice.cpp:28
Definition: AddressSettings.hpp:49
Definition: DeviceSettings.hpp:20
Definition: SharedOutputSettings.hpp:19
The VisitorVariant struct.
Definition: VisitorInterface.hpp:26
Definition: DocumentContext.hpp:18