Open Lighting Architecture 0.10.9
Loading...
Searching...
No Matches
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
31namespace ola {
32
33class Device;
34
35namespace plugin {
36namespace usbdmx {
37
43 public:
51 unsigned int index,
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 JaRuleOutputPort(const JaRuleOutputPort &) = delete;
83 const JaRuleOutputPort &operator=(const JaRuleOutputPort &) = delete;
84};
85} // namespace usbdmx
86} // namespace plugin
87} // namespace ola
88#endif // PLUGINS_USBDMX_JARULEOUTPUTPORT_H_
Helper macros.
The base class for all 1 argument callbacks.
Definition Callback.h:982
Definition Port.h:283
Definition Device.h:89
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
Definition Universe.h:46
A thin wrapper around a JaRulePortHandle so that it can operate as an OLA Port.
Definition JaRuleOutputPort.h:42
bool WriteDMX(const DmxBuffer &buffer, uint8_t priority)
Write DMX data to this port.
Definition JaRuleOutputPort.cpp:62
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
~JaRuleOutputPort()
Destructor.
Definition JaRuleOutputPort.cpp:46
std::string Description() const
Fetch the string description for a Port.
Definition JaRuleOutputPort.cpp:58
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)
Handle an RDMRequest, subclasses can implement this to support RDM.
Definition JaRuleOutputPort.cpp:68
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition JaRuleOutputPort.cpp:73
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition RDMCommand.h:234
Represents a DMX/RDM port on a Ja Rule device.
Definition JaRulePortHandle.h:41
A Ja Rule hardware device (widget).
Definition JaRuleWidget.h:57
The namespace containing all OLA symbols.
Definition Credentials.cpp:44