Open Lighting Architecture  Latest Git
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 
29 namespace ola {
30 namespace plugin {
31 namespace shownet {
32 
34  public:
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 
55  public:
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_
Definition: Universe.h:46
std::string Description() const
Fetch the string description for a Port.
Definition: ShowNetPort.cpp:35
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
Definition: ShowNetNode.h:38
Definition: Port.h:199
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
Definition: PluginAdaptor.h:41
Definition: ShowNetDevice.h:33
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
Definition: ShowNetPort.h:33
Definition: ShowNetPort.h:54
Definition: Port.h:282