Open Lighting Architecture: plugins/pathport/PathportPort.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
PathportPort.h
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU Library General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15 *
16 * PathportPort.h
17 * The Pathport plugin for ola
18 * Copyright (C) 2005 Simon Newton
19 */
20
21#ifndef PLUGINS_PATHPORT_PATHPORTPORT_H_
22#define PLUGINS_PATHPORT_PATHPORTPORT_H_
23
24#include <string>
25#include "ola/DmxBuffer.h"
26#include "olad/Port.h"
27#include "plugins/pathport/PathportDevice.h"
28
29namespace ola {
30namespace plugin {
31namespace pathport {
32
33 class PathportPortHelper {
34 public:
35 PathportPortHelper() {}
36 std::string Description(const Universe *universe) const;
37 bool PreSetUniverse(Universe *new_universe);
38};
39
40
41 class PathportInputPort: public BasicInputPort {
42 public:
43 PathportInputPort(PathportDevice *parent,
44 unsigned int id,
45 class PluginAdaptor *plugin_adaptor,
46 PathportNode *node):
47 BasicInputPort(parent, id, plugin_adaptor),
48 m_node(node) {}
49 ~PathportInputPort() {}
50
51 std::string Description() const {
52 return m_helper.Description(GetUniverse());
53 }
54 const DmxBuffer &ReadDMX() const { return m_buffer; }
55 bool PreSetUniverse(OLA_UNUSED Universe *old_universe,
56 Universe *new_universe) {
57 return m_helper.PreSetUniverse(new_universe);
58 }
59
60 void PostSetUniverse(Universe *old_universe, Universe *new_universe);
61
62 private:
63 PathportPortHelper m_helper;
64 PathportNode *m_node;
65 DmxBuffer m_buffer;
66};
67
68
69 class PathportOutputPort: public BasicOutputPort {
70 public:
71 PathportOutputPort(PathportDevice *parent,
72 unsigned int id,
73 PathportNode *node):
74 BasicOutputPort(parent, id),
75 m_node(node) {}
76 ~PathportOutputPort() {}
77
78 std::string Description() const {
79 return m_helper.Description(GetUniverse());
80 }
81 bool WriteDMX(const DmxBuffer &buffer, uint8_t priority);
82 bool PreSetUniverse(OLA_UNUSED Universe *old_universe,
83 Universe *new_universe) {
84 return m_helper.PreSetUniverse(new_universe);
85 }
86
87 private:
88 PathportPortHelper m_helper;
89 PathportNode *m_node;
90};
91} // namespace pathport
92} // namespace plugin
93} // namespace ola
94#endif // PLUGINS_PATHPORT_PATHPORTPORT_H_
DmxBuffer.h
A class used to hold a single universe of DMX data.
OLA_UNUSED
#define OLA_UNUSED
Mark unused arguments & types.
Definition Macro.h:63
ola::BasicInputPort::BasicInputPort
BasicInputPort(AbstractDevice *parent, unsigned int port_id, const PluginAdaptor *plugin_adaptor, bool supports_rdm=false)
Create a new basic input port.
Definition Port.cpp:38
ola::BasicInputPort::GetUniverse
Universe * GetUniverse() const
Fetch the universe this Port is bound to.
Definition Port.h:212
ola::BasicOutputPort::BasicOutputPort
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
ola::BasicOutputPort::GetUniverse
Universe * GetUniverse() const
Fetch the universe this Port is bound to.
Definition Port.h:296
ola::DmxBuffer
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
ola::PluginAdaptor
Definition PluginAdaptor.h:41
ola::Universe
Definition Universe.h:46
ola::plugin::pathport::PathportDevice
Definition PathportDevice.h:33
ola::plugin::pathport::PathportInputPort::Description
std::string Description() const
Fetch the string description for a Port.
Definition PathportPort.h:51
ola::plugin::pathport::PathportNode
Definition PathportNode.h:37
ola::plugin::pathport::PathportOutputPort::Description
std::string Description() const
Fetch the string description for a Port.
Definition PathportPort.h:78
ola::plugin::pathport::PathportOutputPort::WriteDMX
bool WriteDMX(const DmxBuffer &buffer, uint8_t priority)
Write DMX data to this port.
Definition PathportPort.cpp:73
ola::plugin::pathport
Code for the Pathport protocol.
ola::plugin
Code for supported devices and protocols.
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44