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

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Sunlite.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 * Sunlite.h
17 * The synchronous and asynchronous Sunlite widgets.
18 * Copyright (C) 2014 Simon Newton
19 */
20
21#ifndef PLUGINS_USBDMX_SUNLITE_H_
22#define PLUGINS_USBDMX_SUNLITE_H_
23
24#include <libusb.h>
25#include <memory>
26#include "ola/DmxBuffer.h"
27#include "ola/base/Macro.h"
28#include "ola/thread/Mutex.h"
29#include "plugins/usbdmx/Widget.h"
30
31namespace ola {
32namespace plugin {
33namespace usbdmx {
34
35class SunliteThreadedSender;
36
40 class Sunlite : public SimpleWidget {
41 public:
42 explicit Sunlite(ola::usb::LibUsbAdaptor *adaptor,
43 libusb_device *usb_device)
44 : SimpleWidget(adaptor, usb_device) {
45 }
46};
47
48
54 class SynchronousSunlite: public Sunlite {
55 public:
61 SynchronousSunlite(ola::usb::LibUsbAdaptor *adaptor,
62 libusb_device *usb_device);
63
64 bool Init();
65
66 bool SendDMX(const DmxBuffer &buffer);
67
68 private:
69 std::auto_ptr<class SunliteThreadedSender> m_sender;
70
71 SynchronousSunlite(const SynchronousSunlite &) = delete;
72 const SynchronousSunlite &operator=(const SynchronousSunlite &) = delete;
73};
74
78 class AsynchronousSunlite: public Sunlite {
79 public:
85 AsynchronousSunlite(ola::usb::LibUsbAdaptor *adaptor,
86 libusb_device *usb_device);
87
88 bool Init();
89
90 bool SendDMX(const DmxBuffer &buffer);
91
92 private:
93 std::auto_ptr<class SunliteAsyncUsbSender> m_sender;
94
95 AsynchronousSunlite(const AsynchronousSunlite &) = delete;
96 const AsynchronousSunlite &operator=(const AsynchronousSunlite &) = delete;
97};
98} // namespace usbdmx
99} // namespace plugin
100} // namespace ola
101#endif // PLUGINS_USBDMX_SUNLITE_H_
DmxBuffer.h
A class used to hold a single universe of DMX data.
Macro.h
Helper macros.
ola::DmxBuffer
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
ola::plugin::usbdmx::AsynchronousSunlite::Init
bool Init()
Initialize the widget.
Definition Sunlite.cpp:209
ola::plugin::usbdmx::AsynchronousSunlite::SendDMX
bool SendDMX(const DmxBuffer &buffer)
Send DMX data from this widget.
Definition Sunlite.cpp:213
ola::plugin::usbdmx::AsynchronousSunlite::AsynchronousSunlite
AsynchronousSunlite(ola::usb::LibUsbAdaptor *adaptor, libusb_device *usb_device)
Create a new AsynchronousSunlite.
Definition Sunlite.cpp:202
ola::plugin::usbdmx::SimpleWidget::SimpleWidget
SimpleWidget(ola::usb::LibUsbAdaptor *adaptor, libusb_device *usb_device)
Create a new SimpleWidget.
Definition Widget.h:73
ola::plugin::usbdmx::SunliteThreadedSender
Definition Sunlite.cpp:99
ola::plugin::usbdmx::SynchronousSunlite::SendDMX
bool SendDMX(const DmxBuffer &buffer)
Send DMX data from this widget.
Definition Sunlite.cpp:161
ola::plugin::usbdmx::SynchronousSunlite::SynchronousSunlite
SynchronousSunlite(ola::usb::LibUsbAdaptor *adaptor, libusb_device *usb_device)
Create a new SynchronousSunlite.
Definition Sunlite.cpp:138
ola::plugin::usbdmx::SynchronousSunlite::Init
bool Init()
Initialize the widget.
Definition Sunlite.cpp:143
ola::usb::LibUsbAdaptor
Wraps calls to libusb so we can test the code.
Definition LibUsbAdaptor.h:36
ola::plugin::usbdmx
The plugin for hardware using libusb.
ola::plugin
Code for supported devices and protocols.
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44