Open Lighting Architecture: plugins/usbdmx/JaRuleOutputPort.h Source File

| 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
42 class JaRuleOutputPort: public BasicOutputPort {
43 public:
50 JaRuleOutputPort(Device *parent,
51 unsigned int index,
52 ola::usb::JaRuleWidget *widget);
53
57 ~JaRuleOutputPort();
58
63 bool Init();
64
65 bool WriteDMX(const DmxBuffer &buffer, uint8_t priority);
66
67 std::string Description() const;
68
69 void SendRDMRequest(ola::rdm::RDMRequest *request,
70 ola::rdm::RDMCallback *callback);
71 void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback);
72 void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *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_
Macro.h
Helper macros.
ola::BasicOutputPort::BasicOutputPort
BasicOutputPort(AbstractDevice *parent, unsigned int port_id, bool start_rdm_discovery_on_patch=false, bool supports_rdm=false)
Create a new BasicOutputPort.
Definition Port.cpp:120
ola::Device
Definition Device.h:89
ola::DmxBuffer
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
ola::Universe
Definition Universe.h:46
ola::plugin::usbdmx::JaRuleOutputPort::WriteDMX
bool WriteDMX(const DmxBuffer &buffer, uint8_t priority)
Write DMX data to this port.
Definition JaRuleOutputPort.cpp:62
ola::plugin::usbdmx::JaRuleOutputPort::Init
bool Init()
Initialize the port.
Definition JaRuleOutputPort.cpp:53
ola::plugin::usbdmx::JaRuleOutputPort::RunIncrementalDiscovery
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition JaRuleOutputPort.cpp:78
ola::plugin::usbdmx::JaRuleOutputPort::JaRuleOutputPort
JaRuleOutputPort(Device *parent, unsigned int index, ola::usb::JaRuleWidget *widget)
Create a new JaRuleOutputPort.
Definition JaRuleOutputPort.cpp:37
ola::plugin::usbdmx::JaRuleOutputPort::~JaRuleOutputPort
~JaRuleOutputPort()
Destructor.
Definition JaRuleOutputPort.cpp:46
ola::plugin::usbdmx::JaRuleOutputPort::Description
std::string Description() const
Fetch the string description for a Port.
Definition JaRuleOutputPort.cpp:58
ola::plugin::usbdmx::JaRuleOutputPort::SendRDMRequest
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)
Handle an RDMRequest, subclasses can implement this to support RDM.
Definition JaRuleOutputPort.cpp:68
ola::plugin::usbdmx::JaRuleOutputPort::RunFullDiscovery
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition JaRuleOutputPort.cpp:73
ola::rdm::RDMRequest
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition RDMCommand.h:234
ola::usb::JaRulePortHandle
Represents a DMX/RDM port on a Ja Rule device.
Definition JaRulePortHandle.h:41
ola::usb::JaRuleWidget
A Ja Rule hardware device (widget).
Definition JaRuleWidget.h:57
ola::plugin::usbdmx
The plugin for hardware using libusb.
ola::plugin
Code for supported devices and protocols.
ola::rdm::RDMCallback
ola::BaseCallback1< void, RDMReply * > RDMCallback
The callback run when a RDM request completes.
Definition RDMControllerInterface.h:52
ola::rdm::RDMDiscoveryCallback
ola::BaseCallback1< void, const ola::rdm::UIDSet & > RDMDiscoveryCallback
The callback run when a discovery operation completes.
Definition RDMControllerInterface.h:68
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44