Open Lighting Architecture
 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  *
16  * ShowNetPort.h
17  * The ShowNet plugin for ola
18  * Copyright (C) 2005-2009 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 
33 using ola::DmxBuffer;
34 
36  public:
38  unsigned int id,
39  class PluginAdaptor *plugin_adaptor,
40  ShowNetNode *node):
41  BasicInputPort(parent, id, plugin_adaptor),
42  m_node(node) {}
43  ~ShowNetInputPort() {}
44 
45  string Description() const;
46  const DmxBuffer &ReadDMX() const { return m_buffer; }
47  bool PreSetUniverse(Universe *old_universe, Universe *new_universe);
48  void PostSetUniverse(Universe *old_universe, Universe *new_universe);
49 
50  private :
51  DmxBuffer m_buffer;
52  ShowNetNode *m_node;
53 };
54 
55 
57  public:
59  unsigned int id,
60  ShowNetNode *node):
61  BasicOutputPort(parent, id),
62  m_node(node) {}
63  ~ShowNetOutputPort() {}
64 
65  bool PreSetUniverse(Universe *old_universe, Universe *new_universe);
66  string Description() const;
67  bool WriteDMX(const DmxBuffer &buffer, uint8_t priority);
68 
69  private:
70  ShowNetNode *m_node;
71 };
72 } // namespace shownet
73 } // namespace plugin
74 } // namespace ola
75 #endif // PLUGINS_SHOWNET_SHOWNETPORT_H_