21 #ifndef INCLUDE_OLAD_PORT_H_
22 #define INCLUDE_OLAD_PORT_H_
28 #include <ola/timecode/TimeCode.h>
29 #include <olad/DmxSource.h>
32 #include <olad/Universe.h>
57 virtual unsigned int PortId()
const = 0;
94 virtual std::string
UniqueId()
const = 0;
190 virtual bool SupportsTimeCode()
const = 0;
205 unsigned int port_id,
207 bool supports_rdm =
false);
209 unsigned int PortId()
const {
return m_port_id; }
213 virtual std::string
UniqueId()
const;
246 virtual const DmxBuffer &ReadDMX()
const = 0;
249 virtual uint8_t InheritedPriority()
const {
254 virtual bool PreSetUniverse(Universe *, Universe *) {
return true; }
256 virtual void PostSetUniverse(Universe *, Universe *) {}
262 virtual bool SupportsPriorities()
const {
return false; }
265 const unsigned int m_port_id;
268 mutable std::string m_port_string;
269 Universe *m_universe;
270 AbstractDevice *m_device;
271 DmxSource m_dmx_source;
272 const PluginAdaptor *m_plugin_adaptor;
288 unsigned int port_id,
289 bool start_rdm_discovery_on_patch =
false,
290 bool supports_rdm =
false);
292 unsigned int PortId()
const {
return m_port_id; }
328 virtual bool SupportsTimeCode()
const {
return false; }
339 virtual void PostSetUniverse(Universe *, Universe *) { }
345 virtual bool SupportsPriorities()
const {
return false; }
353 const unsigned int m_port_id;
354 const bool m_discover_on_patch;
357 mutable std::string m_port_string;
358 Universe *m_universe;
359 AbstractDevice *m_device;
369 template<
class PortClass>
373 bool IsInputPort<OutputPort>();
375 #endif // INCLUDE_OLAD_PORT_H_
virtual void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *on_complete)=0
Start a full discovery operation.
Represents a set of RDM UIDs.
Definition: UIDSet.h:48
Definitions and Interfaces to implement an RDMController that sends a single message at a time...
virtual void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)
Handle an RDMRequest, subclasses can implement this to support RDM.
Definition: Port.cpp:168
Definition: DmxSource.h:36
Definition: Universe.h:45
AbstractDevice * GetDevice() const
Get the device which owns this Port.
Definition: Port.h:293
virtual void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *on_complete)=0
Start an incremental discovery operation.
Provides a wrapper for the DeviceManager and SelectServer objects so that the plugins can register de...
port_priority_mode GetPriorityMode() const
Get the Priority Mode for this Port.
Definition: Port.h:300
virtual uint8_t GetPriority() const =0
Get the numeric priority for this Port.
virtual bool SetPriority(uint8_t priority)=0
Set the Priority for this Port.
virtual bool SetUniverse(Universe *universe)=0
Bind this port to a universe.
The interface that can send RDM commands, as well as perform discovery operations.
Definition: RDMControllerInterface.h:104
Definition: PortConstants.h:62
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition: RDMCommand.h:233
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
BasicOutputPort(AbstractDevice *parent, unsigned int port_id, bool start_rdm_discovery_on_patch=false, bool supports_rdm=false)
Create a new BasicOutputPort.
Definition: Port.cpp:120
virtual void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)=0
Send a RDM command.
port_priority_mode
Defines the different priority modes that OLA supports.
Definition: PortConstants.h:44
A port that sends DMX512 data.
Definition: Port.h:163
port_priority_capability
Defines the priority capability of a Port.
Definition: PortConstants.h:58
virtual std::string Description() const =0
Fetch the string description for a Port.
A class used to hold a single universe of DMX data.
virtual port_priority_capability PriorityCapability() const =0
Get the priority capabilities for this port.
virtual unsigned int PortId() const =0
Get the Port ID. This is the index within the device.
void SetPriorityMode(port_priority_mode mode)
Set the Priority Mode for this Port.
Definition: Port.h:299
virtual void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *on_complete)
This is a noop for ports that don't support RDM.
Definition: Port.cpp:188
Definition: TimeCode.h:33
virtual bool SupportsRDM() const
Check if this Port supports RDM or not.
Definition: Port.h:341
virtual bool SendTimeCode(const ola::timecode::TimeCode &)
This is a noop for ports that don't support TimeCode.
Definition: Port.h:333
Definition: PluginAdaptor.h:41
bool IsInputPort()
This allows switching based on Port type.
Definition: Port.cpp:201
virtual void UniverseNameChanged(const std::string &new_name)
Called if the universe name changes.
Definition: Port.h:302
virtual Universe * GetUniverse() const =0
Fetch the universe this Port is bound to.
virtual port_priority_mode GetPriorityMode() const =0
Get the Priority Mode for this Port.
static const uint8_t SOURCE_PRIORITY_MIN
The minimum priority for a source.
Definition: SourcePriorities.h:36
virtual void UniverseNameChanged(const std::string &new_name)=0
Called if the universe name changes.
virtual void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *on_complete)
This is a noop for ports that don't support RDM.
Definition: Port.cpp:182
Different priority modes and priority capabilities. Please make sure to visit Merging Algorithms for ...
port_priority_capability PriorityCapability() const
Get the priority capabilities for this port.
Definition: Port.h:306
std::string UniqueId() const
Return the globally unique id for a Port.
Definition: Port.cpp:150
The base class for all 1 argument callbacks.
Definition: Callback.h:982
virtual AbstractDevice * GetDevice() const =0
Get the device which owns this Port.
virtual std::string UniqueId() const =0
Return the globally unique id for a Port.
bool SetPriority(uint8_t priority)
Set the Priority for this Port.
Definition: Port.cpp:160
Universe * GetUniverse() const
Fetch the universe this Port is bound to.
Definition: Port.h:295
uint8_t GetPriority() const
Get the numeric priority for this Port.
Definition: Port.h:298
Definition: PortConstants.h:60
bool SetUniverse(Universe *universe)
Bind this port to a universe.
Definition: Port.cpp:134
void UpdateUIDs(const ola::rdm::UIDSet &uids)
Called when the discovery triggered by patching completes.
Definition: Port.cpp:194
virtual void SetPriorityMode(port_priority_mode mode)=0
Set the Priority Mode for this Port.
virtual bool WriteDMX(const DmxBuffer &buffer, uint8_t priority)=0
Write DMX data to this port.
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
The base port class.
Definition: Port.h:49
unsigned int PortId() const
Get the Port ID. This is the index within the device.
Definition: Port.h:292
virtual bool SupportsRDM() const =0
Check if this Port supports RDM or not.
Definition: PortConstants.h:64
Classes that represent RDM commands.