/* universe.h Copyright (c) 2020 Kevin Matz (kevin.matz@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #pragma once #include "data.h" #include "dmp/dmp.h" #include "dmx/universe.h" #include #include #include namespace sACN { /** * @brief \cite sACN 3.2 Universe * * > A set of up to 512 data slots identified by universe number. * > Note: In E1.31 there may be multiple sources for a universe. See also: Slot. */ class Universe : public DMX::Universe { public: Universe(); ~Universe(); virtual void set(ACN::PDU::Message, std::shared_ptr); virtual std::shared_ptr provenance() const; virtual void setProvenance(std::shared_ptr); virtual bool isSyncronized() const; virtual void synchronize(uint8_t = 0); protected: /** * @brief \cite sACN 3.7 Active Data Slots * * > When translating ANSI E1.11 DMX512-A \cite DMX to E1.31, the active data * > slots are defined as ranging from data slot 1 to the maximum data slot in * > the most recently received packet with the corresponding START Code. * > * > Devices originating E1.31 shall define their active data slots using * > the DMP First Property Address and DMP Property Count fields shown in * > Table 4-1. */ uint16_t active_data_slots; private: std::shared_ptr provenance_; std::vector * sync_data_ = nullptr; uint8_t sync_sequence_ = 0; }; } // SACN namespace