21 #ifndef INCLUDE_OLAD_PORT_H_
22 #define INCLUDE_OLAD_PORT_H_
28 #include <ola/timecode/TimeCode.h>
29 #include <olad/DmxSource.h>
30 #include <olad/PluginAdaptor.h>
32 #include <olad/Universe.h>
48 virtual unsigned int PortId()
const = 0;
54 virtual std::string Description()
const = 0;
57 virtual bool SetUniverse(
Universe *universe) = 0;
60 virtual Universe *GetUniverse()
const = 0;
64 virtual std::string UniqueId()
const = 0;
69 virtual bool SetPriority(uint8_t priority) = 0;
70 virtual uint8_t GetPriority()
const = 0;
76 virtual bool SupportsRDM()
const = 0;
89 virtual void DmxChanged() = 0;
92 virtual const DmxSource &SourceData()
const = 0;
108 virtual bool WriteDMX(
const DmxBuffer &buffer, uint8_t priority) = 0;
111 virtual void UniverseNameChanged(
const std::string &new_name) = 0;
117 virtual void RunFullDiscovery(
119 virtual void RunIncrementalDiscovery(
123 virtual bool SupportsTimeCode()
const = 0;
135 unsigned int port_id,
137 bool supports_rdm =
false);
139 unsigned int PortId()
const {
return m_port_id; }
141 bool SetUniverse(
Universe *universe);
142 Universe *GetUniverse()
const {
return m_universe; }
143 virtual std::string UniqueId()
const;
144 bool SetPriority(uint8_t priority);
145 uint8_t GetPriority()
const {
return m_priority; }
149 const DmxSource &SourceData()
const {
return m_dmx_source; }
163 virtual const DmxBuffer &ReadDMX()
const = 0;
166 virtual uint8_t InheritedPriority()
const {
175 virtual bool SupportsRDM()
const {
return m_supports_rdm; }
179 virtual bool SupportsPriorities()
const {
return false; }
182 const unsigned int m_port_id;
185 mutable std::string m_port_string;
202 unsigned int port_id,
203 bool start_rdm_discovery_on_patch =
false,
204 bool supports_rdm =
false);
206 unsigned int PortId()
const {
return m_port_id; }
208 bool SetUniverse(
Universe *universe);
209 Universe *GetUniverse()
const {
return m_universe; }
210 std::string UniqueId()
const;
211 bool SetPriority(uint8_t priority);
212 uint8_t GetPriority()
const {
return m_priority; }
216 virtual void UniverseNameChanged(
const std::string &new_name) {
227 virtual void RunFullDiscovery(
229 virtual void RunIncrementalDiscovery(
233 virtual bool SupportsTimeCode()
const {
245 virtual bool SupportsRDM()
const {
return m_supports_rdm; }
249 virtual bool SupportsPriorities()
const {
return false; }
253 const unsigned int m_port_id;
254 const bool m_discover_on_patch;
257 mutable std::string m_port_string;
269 template<
class PortClass>
273 bool IsInputPort<OutputPort>();
275 #endif // INCLUDE_OLAD_PORT_H_