Open Lighting Architecture  0.9.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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_