Open Lighting Architecture: plugins/usbpro/DmxTriDevice.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
DmxTriDevice.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 * DmxTriDevice.h
17 * The Jese DMX-TRI device.
18 * Copyright (C) 2010 Simon Newton
19 */
20
21#ifndef PLUGINS_USBPRO_DMXTRIDEVICE_H_
22#define PLUGINS_USBPRO_DMXTRIDEVICE_H_
23
24#include <string>
25#include "ola/DmxBuffer.h"
26#include "plugins/usbpro/DmxTriWidget.h"
27#include "plugins/usbpro/UsbSerialDevice.h"
28
29namespace ola {
30namespace plugin {
31namespace usbpro {
32
33
34/*
35 * An DMX TRI Device
36 */
37 class DmxTriDevice: public UsbSerialDevice {
38 public:
39 DmxTriDevice(ola::AbstractPlugin *owner,
40 const std::string &name,
41 DmxTriWidget *widget,
42 uint16_t esta_id,
43 uint16_t device_id,
44 uint32_t serial,
45 uint16_t firmware_version);
46 ~DmxTriDevice() {}
47
48 std::string DeviceId() const { return m_device_id; }
49 void PrePortStop();
50
51 private:
52 std::string m_device_id;
53 DmxTriWidget *m_tri_widget;
54};
55
56
57/*
58 * A single output port per device
59 */
60 class DmxTriOutputPort: public BasicOutputPort {
61 public:
62 DmxTriOutputPort(DmxTriDevice *parent,
63 DmxTriWidget *widget,
64 const std::string &description);
65
66 ~DmxTriOutputPort();
67
68 bool WriteDMX(const DmxBuffer &buffer, uint8_t priority);
69 std::string Description() const { return m_description; }
70
71 void SendRDMRequest(ola::rdm::RDMRequest *request,
72 ola::rdm::RDMCallback *callback) {
73 m_tri_widget->SendRDMRequest(request, callback);
74 }
75
76 void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback) {
77 m_tri_widget->RunFullDiscovery(callback);
78 }
79
80 void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback) {
81 m_tri_widget->RunIncrementalDiscovery(callback);
82 }
83
84 private:
85 DmxTriWidget *m_tri_widget;
86 const std::string m_description;
87};
88} // namespace usbpro
89} // namespace plugin
90} // namespace ola
91#endif // PLUGINS_USBPRO_DMXTRIDEVICE_H_
DmxBuffer.h
A class used to hold a single universe of DMX data.
ola::AbstractPlugin
Definition Plugin.h:38
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::DmxBuffer
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
ola::plugin::usbpro::DmxTriDevice
Definition DmxTriDevice.h:37
ola::plugin::usbpro::DmxTriDevice::DeviceId
std::string DeviceId() const
The device ID.
Definition DmxTriDevice.h:48
ola::plugin::usbpro::DmxTriOutputPort::DmxTriOutputPort
DmxTriOutputPort(DmxTriDevice *parent, DmxTriWidget *widget, const std::string &description)
Definition DmxTriDevice.cpp:74
ola::plugin::usbpro::DmxTriOutputPort::WriteDMX
bool WriteDMX(const DmxBuffer &buffer, uint8_t priority)
Write DMX data to this port.
Definition DmxTriDevice.cpp:93
ola::plugin::usbpro::DmxTriOutputPort::SendRDMRequest
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)
Handle an RDMRequest, subclasses can implement this to support RDM.
Definition DmxTriDevice.h:71
ola::plugin::usbpro::DmxTriOutputPort::RunFullDiscovery
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition DmxTriDevice.h:76
ola::plugin::usbpro::DmxTriOutputPort::RunIncrementalDiscovery
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition DmxTriDevice.h:80
ola::plugin::usbpro::DmxTriOutputPort::Description
std::string Description() const
Fetch the string description for a Port.
Definition DmxTriDevice.h:69
ola::plugin::usbpro::DmxTriWidget
Definition DmxTriWidget.h:218
ola::rdm::RDMRequest
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition RDMCommand.h:234
ola::plugin::usbpro
Code for Enttec USB Pro devices and others using the same protocol.
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