Open Lighting Architecture: plugins/espnet/EspNetPort.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
EspNetPort.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 * EspNetPort.h
17 * The ESPNet plugin for ola
18 * Copyright (C) 2005 Simon Newton
19 */
20
21#ifndef PLUGINS_ESPNET_ESPNETPORT_H_
22#define PLUGINS_ESPNET_ESPNETPORT_H_
23
24#include <string>
25#include "ola/DmxBuffer.h"
26#include "olad/Port.h"
27#include "plugins/espnet/EspNetDevice.h"
28
29namespace ola {
30namespace plugin {
31namespace espnet {
32
33 class EspNetPortHelper {
34 public:
35 std::string Description(Universe *universe) const;
36 uint8_t EspNetUniverseId(Universe *universe) const;
37};
38
39
40 class EspNetInputPort: public BasicInputPort {
41 public:
42 EspNetInputPort(EspNetDevice *parent, unsigned int id,
43 class PluginAdaptor *plugin_adaptor,
44 EspNetNode *node)
45 : BasicInputPort(parent, id, plugin_adaptor),
46 m_helper(),
47 m_node(node) {}
48 ~EspNetInputPort() {}
49
50 std::string Description() const {
51 return m_helper.Description(GetUniverse());
52 }
53 void PostSetUniverse(Universe *old_universe, Universe *new_universe);
54 const DmxBuffer &ReadDMX() const { return m_buffer; }
55
56 private:
57 EspNetPortHelper m_helper;
58 EspNetNode *m_node;
59 DmxBuffer m_buffer;
60};
61
62
63 class EspNetOutputPort: public BasicOutputPort {
64 public:
65 EspNetOutputPort(EspNetDevice *parent, unsigned int id, EspNetNode *node)
66 : BasicOutputPort(parent, id),
67 m_helper(),
68 m_node(node) {}
69 ~EspNetOutputPort() {}
70
71 std::string Description() const {
72 return m_helper.Description(GetUniverse());
73 }
74 bool WriteDMX(const DmxBuffer &buffer, uint8_t priority);
75
76 private:
77 EspNetPortHelper m_helper;
78 EspNetNode *m_node;
79};
80} // namespace espnet
81} // namespace plugin
82} // namespace ola
83#endif // PLUGINS_ESPNET_ESPNETPORT_H_
DmxBuffer.h
A class used to hold a single universe of DMX data.
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::espnet::EspNetDevice
Definition EspNetDevice.h:32
ola::plugin::espnet::EspNetInputPort::Description
std::string Description() const
Fetch the string description for a Port.
Definition EspNetPort.h:50
ola::plugin::espnet::EspNetNode
Definition EspNetNode.h:49
ola::plugin::espnet::EspNetOutputPort::Description
std::string Description() const
Fetch the string description for a Port.
Definition EspNetPort.h:71
ola::plugin::espnet::EspNetOutputPort::WriteDMX
bool WriteDMX(const DmxBuffer &buffer, uint8_t priority)
Write DMX data to this port.
Definition EspNetPort.cpp:76
ola::plugin::espnet::EspNetPortHelper
Definition EspNetPort.h:33
ola::plugin::espnet
Code for the ESPNet protocol.
ola::plugin
Code for supported devices and protocols.
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44