Loading...
Searching...
No Matches
OSCProtocolSettingsWidget.hpp
1#pragma once
2#include <Device/Protocol/DeviceSettings.hpp>
3#include <Device/Protocol/ProtocolSettingsWidget.hpp>
4
5#include <Protocols/OSC/OSCSpecificSettings.hpp>
6
7#include <verdigris>
8
9class QStackedLayout;
10class QLineEdit;
11class QSpinBox;
12class QWidget;
13class QFormLayout;
14
15namespace Protocols
16{
17
18class UDPWidget;
19class TCPWidget;
20class TCPServerWidget;
21class UnixDatagramWidget;
22class UnixStreamWidget;
23class SerialWidget;
24class WebsocketClientWidget;
25class WebsocketServerWidget;
26
27class RateWidget;
28
29enum class OscProtocol
30{
31 UDP = 0,
32 TCP = 1,
33 Serial = 2,
34 UnixDatagram = 3,
35 UnixStream = 4,
36 WSClient = 5,
37 WSServer = 6,
38 TCPServer = 7
39};
40
41class OSCTransportWidget : public QWidget
42{
43public:
44 explicit OSCTransportWidget(
45 Device::ProtocolSettingsWidget& proto, QWidget* parent = nullptr);
46
47 void setCurrentProtocol(OscProtocol index);
48 ossia::net::osc_protocol_configuration configuration(OscProtocol index) const noexcept;
49 OscProtocol setConfiguration(const ossia::net::osc_protocol_configuration& conf);
50
51private:
52 QStackedLayout* m_transportLayout{};
53
54 UDPWidget* m_udp{};
55 TCPWidget* m_tcp{};
56 TCPServerWidget* m_tcp_server{};
57 SerialWidget* m_serial{};
58 UnixDatagramWidget* m_unix_dgram{};
59 UnixStreamWidget* m_unix_stream{};
60 WebsocketClientWidget* m_ws_client{};
61 WebsocketServerWidget* m_ws_server{};
62};
63
65{
66public:
67 explicit OSCProtocolSettingsWidget(QWidget* parent = nullptr);
68
69 Device::DeviceSettings getSettings() const override;
70 Device::Node getDevice() const override;
71 void setSettings(const Device::DeviceSettings& settings) override;
72
73 using Device::ProtocolSettingsWidget::checkForChanges;
74
75private:
76 void setDefaults();
77 QLineEdit* m_deviceNameEdit{};
78 RateWidget* m_rate{};
79 QCheckBox* m_bonjour{};
80 QCheckBox* m_bundle{};
81 QComboBox* m_transport{};
82 QComboBox* m_oscVersion{};
83 QSpinBox* m_oscquery{};
84 OSCTransportWidget* m_transportWidget{};
85 OSCSpecificSettings m_settings;
86};
87}
Definition ProtocolSettingsWidget.hpp:22
Definition OSCProtocolSettingsWidget.hpp:65
Definition OSCProtocolSettingsWidget.hpp:42
Definition RateWidget.hpp:15
Definition SerialWidget.hpp:15
Definition TCPServerWidget.hpp:15
Definition TCPWidget.hpp:64
Definition UDPWidget.hpp:16
Definition UnixDatagramWidget.hpp:12
Definition UnixStreamWidget.hpp:15
Definition WebsocketClientWidget.hpp:12
Definition WebsocketServerWidget.hpp:12
Definition DeviceSettings.hpp:20
Definition OSCSpecificSettings.hpp:12