#ifndef QSACNNODE_H #define QSACNNODE_H #include "qsacnnode_global.h" #include "../../sacn/node.h" #include #include namespace SACN { // 9.3.1 Allocation of IPv4 Multicast Addresses // Multicast addresses are from the IPv4 Local Scope. inline QHostAddress IPv4MulticastAddress(uint16_t universe) { quint32 address = 239 << 24 | 255 << 16 | universe; return QHostAddress(address); }; // 9.3.2 Allocation of IPv6 Multicast Addresses inline QHostAddress IPv6MulticastAddress(uint16_t universe) { quint8 address [] = {255, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 0, (quint8)(universe >> 8), (quint8)(universe & 0xff)}; return QHostAddress(address); }; class QT_EXPORT QSacnNode : public QUdpSocket , public Node { Q_OBJECT public: QSacnNode(UUID::uuid = UUID::uuid()); virtual void subscribe(const uint16_t universe = 1); virtual void unsubscribe(const uint16_t); signals: void foundUniverse(std::shared_ptr); private: void UdpStreamHandler(); void emitFound(std::shared_ptr); }; } // namespace SACN #endif // QSACNNODE_H