#pragma once #include #include #include #include #include "qsacn_global.h" #include "universe.h" /** * @brief The QSacnUniverse class * * Rather than QSacnNode reimplemnting the sACN::Node api for a QSacnUniverse that uses * sACN::Universe as a base class, the QSacnUniverse class wraps a sACN::Universe. */ class QT_EXPORT QSacnUniverse : public QObject { Q_OBJECT public: explicit QSacnUniverse(QObject *parent = nullptr, std::shared_ptr universe = nullptr); virtual ~QSacnUniverse(); const QString sourceName() const; uint16_t number() const; uint8_t priority() const; double rxRate() const; uint8_t status() const; uint8_t slot(const uint16_t) const; uint16_t activeSlots() const; bool isEditable() const; bool hasSources() const; const QList sources() const; QSacnUniverse* sourceUniverse(const sACN::DATA::data_header&) const; bool getHoldLastLook() const; sACN::UniverseArbitrator::MergeMode getMergeMode() const; public slots: void setHoldLastLook(bool state); void setMergeMode(const sACN::UniverseArbitrator::MergeMode); void setPriority(uint8_t p); void setSyncAddress(uint16_t a); void setValue (const uint16_t addr, const uint8_t level); void setValue (const uint16_t addr, const uint16_t size, const uint8_t* profile); void syncSources(); signals: void dataChanged(); void sourceListChanged(); void statusChanged(); private: std::shared_ptr universe_; QMap sources_; std::shared_ptr data_change_token; std::shared_ptr list_change_token; std::shared_ptr status_change_token; QTimer *status_watchdog_; }; Q_DECLARE_METATYPE(QSacnUniverse*)