Open Lighting Architecture: plugins/shownet/ShowNetPort.h Source File

| Open Lighting Architecture 0.10.9

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