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

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
DmxterDevice.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 * DmxterDevice.h
17 * The Goddard Design Dmxter RDM and miniDmxter
18 * Copyright (C) 2010 Simon Newton
19 */
20
21#ifndef PLUGINS_USBPRO_DMXTERDEVICE_H_
22#define PLUGINS_USBPRO_DMXTERDEVICE_H_
23
24#include <string>
25#include "ola/DmxBuffer.h"
26#include "plugins/usbpro/DmxterWidget.h"
27#include "plugins/usbpro/UsbSerialDevice.h"
28
29namespace ola {
30namespace plugin {
31namespace usbpro {
32
33/*
34 * An DMXter Device
35 */
36 class DmxterDevice: public UsbSerialDevice {
37 public:
38 DmxterDevice(ola::AbstractPlugin *owner,
39 const std::string &name,
40 DmxterWidget *widget,
41 uint16_t esta_id,
42 uint16_t device_id,
43 uint32_t serial);
44 std::string DeviceId() const { return m_device_id; }
45
46 private:
47 std::string m_device_id;
48};
49
50
51/*
52 * A single Output port per device
53 */
54 class DmxterOutputPort: public BasicOutputPort {
55 public:
56 DmxterOutputPort(DmxterDevice *parent, DmxterWidget *widget)
57 : BasicOutputPort(parent, 0, true, true),
58 m_widget(widget) {}
59
60 bool WriteDMX(OLA_UNUSED const DmxBuffer &buffer,
61 OLA_UNUSED uint8_t priority) {
62 // this device can't output DMX
63 return true;
64 }
65
66 void SendRDMRequest(ola::rdm::RDMRequest *request,
67 ola::rdm::RDMCallback *callback) {
68 m_widget->SendRDMRequest(request, callback);
69 }
70
71 void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *on_complete) {
72 m_widget->RunFullDiscovery(on_complete);
73 }
74
75 void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *on_complete) {
76 m_widget->RunIncrementalDiscovery(on_complete);
77 }
78
79 std::string Description() const { return "RDM Only"; }
80
81 private:
82 DmxterWidget *m_widget;
83};
84} // namespace usbpro
85} // namespace plugin
86} // namespace ola
87#endif // PLUGINS_USBPRO_DMXTERDEVICE_H_
DmxBuffer.h
A class used to hold a single universe of DMX data.
OLA_UNUSED
#define OLA_UNUSED
Mark unused arguments & types.
Definition Macro.h:63
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::DmxterDevice
Definition DmxterDevice.h:36
ola::plugin::usbpro::DmxterDevice::DeviceId
std::string DeviceId() const
The device ID.
Definition DmxterDevice.h:44
ola::plugin::usbpro::DmxterOutputPort::WriteDMX
bool WriteDMX(const DmxBuffer &buffer, uint8_t priority)
Write DMX data to this port.
Definition DmxterDevice.h:60
ola::plugin::usbpro::DmxterOutputPort::Description
std::string Description() const
Fetch the string description for a Port.
Definition DmxterDevice.h:79
ola::plugin::usbpro::DmxterOutputPort::SendRDMRequest
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)
Handle an RDMRequest, subclasses can implement this to support RDM.
Definition DmxterDevice.h:66
ola::plugin::usbpro::DmxterOutputPort::RunIncrementalDiscovery
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *on_complete)
This is a noop for ports that don't support RDM.
Definition DmxterDevice.h:75
ola::plugin::usbpro::DmxterOutputPort::RunFullDiscovery
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *on_complete)
This is a noop for ports that don't support RDM.
Definition DmxterDevice.h:71
ola::plugin::usbpro::DmxterWidget
Definition DmxterWidget.h:131
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