Open Lighting Architecture: plugins/ftdidmx/FtdiDmxPort.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
FtdiDmxPort.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 * FtdiDmxPort.h
17 * The FTDI usb chipset DMX plugin for ola
18 * Copyright (C) 2011 Rui Barreiros
19 *
20 * Additional modifications to enable support for multiple outputs and
21 * additional device ids did change the original structure.
22 *
23 * by E.S. Rosenberg a.k.a. Keeper of the Keys 5774/2014
24 */
25
26#ifndef PLUGINS_FTDIDMX_FTDIDMXPORT_H_
27#define PLUGINS_FTDIDMX_FTDIDMXPORT_H_
28
29#include <string>
30
31#include "ola/DmxBuffer.h"
32#include "olad/Port.h"
33#include "olad/Preferences.h"
34#include "plugins/ftdidmx/FtdiDmxDevice.h"
35#include "plugins/ftdidmx/FtdiWidget.h"
36#include "plugins/ftdidmx/FtdiDmxThread.h"
37
38namespace ola {
39namespace plugin {
40namespace ftdidmx {
41
42 class FtdiDmxOutputPort : public ola::BasicOutputPort {
43 public:
44 FtdiDmxOutputPort(FtdiDmxDevice *parent,
45 FtdiInterface *interface,
46 unsigned int id,
47 unsigned int freq)
48 : BasicOutputPort(parent, id),
49 m_interface(interface),
50 m_thread(interface, freq) {
51 m_thread.Start();
52 }
53 ~FtdiDmxOutputPort() {
54 m_thread.Stop();
55 delete m_interface;
56 }
57
58 bool WriteDMX(const ola::DmxBuffer &buffer, uint8_t) {
59 return m_thread.WriteDMX(buffer);
60 }
61
62 std::string Description() const { return m_interface->Description(); }
63
64 private:
65 FtdiInterface *m_interface;
66 FtdiDmxThread m_thread;
67};
68} // namespace ftdidmx
69} // namespace plugin
70} // namespace ola
71#endif // PLUGINS_FTDIDMX_FTDIDMXPORT_H_
DmxBuffer.h
A class used to hold a single universe of DMX data.
ola::BasicOutputPort
Definition Port.h:283
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::ftdidmx::FtdiDmxDevice
Definition FtdiDmxDevice.h:40
ola::plugin::ftdidmx::FtdiDmxOutputPort::Description
std::string Description() const
Fetch the string description for a Port.
Definition FtdiDmxPort.h:62
ola::plugin::ftdidmx::FtdiDmxOutputPort::WriteDMX
bool WriteDMX(const ola::DmxBuffer &buffer, uint8_t)
Write DMX data to this port.
Definition FtdiDmxPort.h:58
ola::plugin::ftdidmx::FtdiDmxThread
Definition FtdiDmxThread.h:36
ola::plugin::ftdidmx::FtdiInterface
Definition FtdiWidget.h:183
ola::plugin::ftdidmx
Code for FTDI devices.
ola::plugin
Code for supported devices and protocols.
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44