Open Lighting Architecture  0.10.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
JaRuleOutputPort.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  * JaRuleOutputPort.h
17  * A JaRule output port that uses a widget.
18  * Copyright (C) 2015 Simon Newton
19  */
20 
21 #ifndef PLUGINS_USBDMX_JARULEOUTPUTPORT_H_
22 #define PLUGINS_USBDMX_JARULEOUTPUTPORT_H_
23 
24 #include <string>
25 #include "ola/base/Macro.h"
26 #include "olad/Port.h"
27 
28 #include "libs/usb/JaRulePortHandle.h"
29 #include "libs/usb/JaRuleWidget.h"
30 
31 namespace ola {
32 
33 class Device;
34 
35 namespace plugin {
36 namespace usbdmx {
37 
43  public:
50  JaRuleOutputPort(Device *parent,
51  unsigned int index,
52  ola::usb::JaRuleWidget *widget);
53 
58 
63  bool Init();
64 
65  bool WriteDMX(const DmxBuffer &buffer, uint8_t priority);
66 
67  std::string Description() const;
68 
70  ola::rdm::RDMCallback *callback);
73 
74  bool PreSetUniverse(Universe *old_universe, Universe *new_universe);
75  void PostSetUniverse(Universe *old_universe, Universe *new_universe);
76 
77  private:
78  const unsigned int m_port_index;
79  ola::usb::JaRuleWidget *m_widget; // not owned
80  ola::usb::JaRulePortHandle *m_port_handle; // not owned
81 
82  DISALLOW_COPY_AND_ASSIGN(JaRuleOutputPort);
83 };
84 } // namespace usbdmx
85 } // namespace plugin
86 } // namespace ola
87 #endif // PLUGINS_USBDMX_JARULEOUTPUTPORT_H_
Definition: Universe.h:45
bool WriteDMX(const DmxBuffer &buffer, uint8_t priority)
Write DMX data to this port.
Definition: JaRuleOutputPort.cpp:62
std::string Description() const
Fetch the string description for a Port.
Definition: JaRuleOutputPort.cpp:58
Represents a DMX/RDM port on a Ja Rule device.
Definition: JaRulePortHandle.h:41
Definition: Device.h:89
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition: RDMCommand.h:233
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition: JaRuleOutputPort.cpp:73
A Ja Rule hardware device (widget).
Definition: JaRuleWidget.h:57
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)
Handle an RDMRequest, subclasses can implement this to support RDM.
Definition: JaRuleOutputPort.cpp:68
bool Init()
Initialize the port.
Definition: JaRuleOutputPort.cpp:53
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition: JaRuleOutputPort.cpp:78
JaRuleOutputPort(Device *parent, unsigned int index, ola::usb::JaRuleWidget *widget)
Create a new JaRuleOutputPort.
Definition: JaRuleOutputPort.cpp:37
The base class for all 1 argument callbacks.
Definition: Callback.h:982
A thin wrapper around a JaRulePortHandle so that it can operate as an OLA Port.
Definition: JaRuleOutputPort.h:42
Helper macros.
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
~JaRuleOutputPort()
Destructor.
Definition: JaRuleOutputPort.cpp:46
Definition: Port.h:282