CameraDevice.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/CameraSettings.hpp>
8 #include <Gfx/GfxInputDevice.hpp>
9 
10 class QComboBox;
11 class QLineEdit;
12 
13 namespace Gfx
14 {
16 {
17  SCORE_CONCRETE("d615690b-f2e2-447b-b70e-a800552db69c")
18  QString prettyName() const noexcept override;
19  QString category() const noexcept override;
20  QUrl manual() const noexcept override;
21  Device::DeviceEnumerators
22  getEnumerators(const score::DocumentContext& ctx) const override;
23 
24  Device::DeviceInterface* makeDevice(
25  const Device::DeviceSettings& settings,
26  const Explorer::DeviceDocumentPlugin& plugin,
27  const score::DocumentContext& ctx) override;
28  const Device::DeviceSettings& defaultSettings() const noexcept override;
29  Device::AddressDialog* makeAddAddressDialog(
30  const Device::DeviceInterface& dev, const score::DocumentContext& ctx,
31  QWidget* parent) override;
32  Device::AddressDialog* makeEditAddressDialog(
34  const score::DocumentContext& ctx, QWidget*) override;
35 
36  Device::ProtocolSettingsWidget* makeSettingsWidget() 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 
48 class CameraDevice final : public GfxInputDevice
49 {
50  W_OBJECT(CameraDevice)
51 public:
52  using GfxInputDevice::GfxInputDevice;
53  ~CameraDevice();
54 
55 private:
56  bool reconnect() override;
57  ossia::net::device_base* getDevice() const override { return m_dev.get(); }
58 
60  mutable std::unique_ptr<Gfx::video_texture_input_device> m_dev;
61 };
62 }
63 
64 SCORE_SERIALIZE_DATASTREAM_DECLARE(, Gfx::CameraSettings);
65 Q_DECLARE_METATYPE(Gfx::CameraSettings)
66 W_REGISTER_ARGTYPE(Gfx::CameraSettings)
Definition: ProtocolSettingsWidget.hpp:41
Definition: DeviceInterface.hpp:66
Definition: ProtocolFactoryInterface.hpp:47
Definition: ProtocolSettingsWidget.hpp:22
Definition: CameraDevice.hpp:49
Definition: CameraDevice.hpp:16
Definition: GfxDevice.hpp:14
Definition: GfxInputDevice.hpp:126
Binds the rendering pipeline to ossia processes.
Definition: CameraDevice.cpp:28
Definition: AddressSettings.hpp:49
Definition: DeviceSettings.hpp:20
Definition: CameraSettings.hpp:8
The VisitorVariant struct.
Definition: VisitorInterface.hpp:26
Definition: DocumentContext.hpp:18